1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Toolbox in custom module

Toolbox in custom module

2 posts, 0 answered
  1. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    20 Jun 2007
    Link to this post
    Hi,

    I'm working on admin tools for a custom module.  I'm in a situation where my control panel (or a child control of it) needs to be able to access methods in the toolbox on the left sde of the page.  Is there a way to do this?

    Thanks,
    craig
  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    21 Jun 2007
    Link to this post
    Hi fregas,

    Yes, you can achieve this. Try adding the code below to your ControlPanel control:

    public string CommandPanelId  
            {  
                get 
                {  
                    object obj1 = ViewState["CommandPanelId"];  
                    if (obj1 != null)  
                        return (string)obj1;  
                    return string.Empty;  
                }  
                set 
                {  
                    ViewState["CommandPanelId"] = value;  
                }  
            }  
     
            protected virtual void CommandPanel  
            {  
                get 
                {  
                    this.BindToCommandPanel();  
                    return this.cmndPnl;  
                }  
            }  
     
            protected void BindToCommandPanel()  
            {  
                if (cmndPnl != null && !String.IsNullOrEmpty(this.CommandPanelId))  
                    this.cmndPnl = (CommandPanel)ControlHelper.FindControl(thisthis.CommandPanelID);  
            }  
     
            private CommandPanel cmndPnl; 

    In this example CommandPanel is the class corresponding to your Toolbox control. You should give the value of the CommandPanelId in an appropriate place, it would be best if you do this after the creation of the ControlPanel control.

    Best wishes,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered