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

Customising TitleBar from codebehind

1 Answer 50 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
tentonipete asked on 18 Feb 2009, 10:37 AM
I am writing a solution which means I have to create all of my docks programatically.

The problem I am coming across is creating the Commands in the TitleBar in the way I need them to look.

I have no problem creating custom commands and adding those (they appear on the right).

The only difference is that I require the DockExpandCollapseCommand on the left of the title.

// I want this to be a command, not a hyperlink, but I can't add commands to the controls collection
HyperLink hl = 
new HyperLink(); 
hl.NavigateUrl = "/url.aspx"
hl.Text = "CollapseCommand"

// Title
Label lbl = new Label(); 
lbl.Text = tempDock.Title; 
// Create a command for the "Edit" button 
DockCommand cmd = new DockCommand(); 
cmd.Name = "cmdHelp"
cmd.AutoPostBack = false
cmd.CssClass = "helpButton"
cmd.Text = "Help"

I can add things to the TitlebarContainer but I'm not sure this is the right way to do things.

Ideally i want the layout:

[ CollapseCommand | Title                CustomCommand1 | CustomCommand 2 ]

Thanks for your help!

1 Answer, 1 is accepted

Sort by
Petio Petkov
Telerik team
answered on 20 Feb 2009, 01:26 PM
Hello tentonipete,

You can add buttons(not dockCommands) to the titleBar template which will expand/collapse RadDock via javascript on the client. Also you can achieve the same visual effect with css, e.g.
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
<html xmlns="" > 
<head runat="server">  
    <title>Untitled Page</title> 
    <style type="text/css">  
         position: relative;  
         left: -254px;  
        padding-left: 24px !important;  
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server">  
        <telerik:RadDock ID="RadDock1" runat="server" Title="Title" Width="300px">  

Hope this helps!

All the best,
Petio Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Asked by
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Share this question