Create Dock Title Template dynamically

4 posts, 0 answers
  1. Golu
    Golu avatar
    41 posts
    Member since:
    Dec 2008

    Posted 28 Jul 2009 Link to this post

    Dear sir,

    How can we create Dock's Title Template dynamically .

    thanks with regards
  2. Vyrban
    Vyrban avatar
    31 posts
    Member since:
    Nov 2008

    Posted 31 Jul 2009 Link to this post

    Hi Golu ,

    If you put in code-behind a code like:
            protected void Page_Load(object sender, EventArgs e)
            {
                RadDock1.Title = DateTime.Now.ToString();
            }
    it will set dynamically content in dock title. Is this what you need  or something else?
  3. Golu
    Golu avatar
    41 posts
    Member since:
    Dec 2008

    Posted 31 Jul 2009 Link to this post

    Hello Mr. Vyrban
    Thanks for replying, but i m not talk about to set dock title,

    I need dock title template so that after dock is added change its title.
    See demo edit title. In that edit title but its at desgin time, and I have to set this functionality at dynamically.

    thanks with regards
  4. Jim
    Jim avatar
    31 posts
    Member since:
    Jun 2009

    Posted 04 Aug 2009 Link to this post

    You can dynamically add Controls to the TitleBarContainer Controls collection in the following way:

    For an example if you have a RadDock in the .aspx
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server">  
      <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="300px" Width="300px">  
         <telerik:RadDock ID="RadDock1" runat="server" Width="300px" Title="RadDock-Title">  
           <ContentTemplate>  
             <asp:Label ID="Label1" runat="server" Text="TextNotChanged"></asp:Label>  
           </ContentTemplate>  
         </telerik:RadDock>  
      </telerik:RadDockZone>  
    </telerik:RadDockLayout>  

    When the page initializes we can add a LinkButton control to its TitleBarContainer, and attach an event handler method to the LinkButton Click event
    protected void Page_Init(object sender, EventArgs e)  
    {  
        LinkButton LinkButton1 = new LinkButton();  
        LinkButton1.Text = "LinkButton Text";  
      
        // attach an event handler to the Click event  
        LinkButton1.Click += new EventHandler(LinkButton_Click);  
      
        // add the LinkButton to the RadDock's TitleBar template  
        RadDock1.TitlebarContainer.Controls.Add(LinkButton1);  
      
    }  
      
    protected void LinkButton_Click(object sender, EventArgs e)  
    {  
        Label1.Text = DateTime.Now.ToString();  
    }  


Back to Top