Access Controls inside RADDock

2 posts, 1 answers
  1. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 05 May 2008 Link to this post

    Dear All,
    I have a masterpage with header user control, this user control has a RadDock
    where I placed (RadMenu, Radtoolbar) objects inside a table definition inside RadDock as shown in the code below:

    <telerik:RadDockLayout id="dockManagerToolbar" runat="server" SkinID="Dock" /> 
            <telerik:RadDockZone ID="dockZoneToolbar" runat="server" Height="25px" Width="100%" Orientation="horizontal">  
                <telerik:RadDock ID="dockObjectToolbar" runat="server" Height="25px" Width="0px" DockMode="Default" Text="Toolbar" Pinned="True" > 
                    <ContentTemplate> 
                        <table cellpadding="0" cellspacing="0" border="0" style="width: 100%;">  
                        <tr> 
                            <td> 
                                <telerik:RadToolBar id="toolBar" Runat="server" SkinID="Toolbar">  
                                </telerik:RadToolBar> 
                            </td> 
                            <td> 
                                <telerik:RadMenu id="menuToolbar" runat="server" SkinID="Menu" clicktoopen="True" ></telerik:RadMenu> 
                            </td> 
                        </tr> 
                        </table> 
                    </ContentTemplate>        
                    <Commands> 
                        <telerik:DockCommand Name="Pin" Text="Pin" /> 
                        <telerik:DockCommand Name="Unpin" Text="Unpin" /> 
                    </Commands> 
                </telerik:RadDock> 
            </telerik:RadDockZone> 

    However when I try to access the toolbar object using findcontrol in the page load of the master page, it returns null.
    protected void Page_Load(object sender, EventArgs e)  
        {  
            mtoolBar = dockObjectToolbar.FindControl("toolBar"as RadToolBar;  
            mtoolBar.Items.Clear();  
            mtoolBar.LoadContentFile("~/Context Menus/en/Toolbar.xml");  
     
            mToolBar = dockObjectToolbar.FindControl("menuToolbar"as RadMenu;  
            mToolBar.Items.Clear();  
            mToolBar.LoadContentFile("~/Context Menus/en/menuToolbar.xml");  
            mToolBar.Items[0].CssClass = "firstItem";  
              
            UpdateMenuImages();  
        } 

    What could be the reason for that.
    Thanks and best regards

    Waleed
  2. Answer
    Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 06 May 2008 Link to this post

    Never mind, I re-created the user control ...

    Thanks,
    Waleed
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top