This is a migrated thread and some comments may be shown as answers.

Create Dock Title Template dynamically

3 Answers 104 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Golu
Top achievements
Rank 1
Golu asked on 28 Jul 2009, 12:28 PM
Dear sir,

How can we create Dock's Title Template dynamically .

thanks with regards

3 Answers, 1 is accepted

Sort by
0
Vyrban
Top achievements
Rank 1
answered on 31 Jul 2009, 08:15 AM
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?
0
Golu
Top achievements
Rank 1
answered on 01 Aug 2009, 04:39 AM
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
0
Jim
Top achievements
Rank 1
answered on 04 Aug 2009, 07:18 AM
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();  
}  


Tags
Dock
Asked by
Golu
Top achievements
Rank 1
Answers by
Vyrban
Top achievements
Rank 1
Golu
Top achievements
Rank 1
Jim
Top achievements
Rank 1
Share this question
or