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

Error: dock.TitlebarContainer does not work when dock is set resizable

1 Answer 59 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Edan Evantal
Top achievements
Rank 1
Edan Evantal asked on 15 Oct 2008, 09:43 AM
You can't add dock.TitlebarContainer.controls.add if dock.resizable = true;

Please pay attention to this bug.

The next thing I want to add is according the resizing the control.
Well if I put raddock control into some div which can be resized and raddock mode is docked I can't change its width via java script.

Can you write a sample of resizing the raddock via undocking and docking via java script.

Sample: User Comtrol inside the raddock. User Control has a button. when I make click on the button I want the raddock will be resize to 300X300 let's say.

Thanks. It is very important and I think not only for me.

1 Answer, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 17 Oct 2008, 01:21 PM
I tried the following code and it works:
Label lbl = new Label();
lbl.Text = lbl.ID=
"Label1";
RadDock1.TitlebarContainer.Controls.Add(lbl);


As for the RadDock client-side resize you should use set_width and set_height client methods, e.g.
<script type="text/javascript">
function ResizeDock()
{
    var dock =$find('<%=RadDock1.ClientID%>');
    if(dock.get_dockZoneID() == "")
    { 
        dock.set_width(500);
        dock.set_height(500);
    }
}
</script>

For your convenience you can try the example below
DEFAULT.ASPX:
 
<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head> 
    <title>Untitled Page</title> 
    <script type="text/javascript">  
    function ResizeDock()  
    {  
        var dock =$find('<%=RadDock1.ClientID%>');  
        if(dock.get_dockZoneID() == "")  
        {      
             dock.set_width(500);  
             dock.set_height(500);  
        }  
    }  
    </script> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div> 
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server">  
        <telerik:RadDockZone ID="RadDockZone1" runat="server" Width="300px">  
            <telerik:RadDock ID="RadDock1" runat="server" Width="300px" 
             Text="RadDock1"   
             Title="TeleRik" 
             Resizable="true" > 
             <ContentTemplate> 
                <uc1:WebUserControl ID="WebUserControl1" runat="server" /> 
             </ContentTemplate> 
            </telerik:RadDock> 
        </telerik:RadDockZone> 
    </telerik:RadDockLayout> 
          
    </div> 
    </form> 
</body> 
</html> 
DEFAULT.CODEBEHIND:
 protected void Page_Load(object sender, EventArgs e)  
    {  
        Label lbl = new Label();  
        lbl.Text = lbl.ID="Label1";  
        RadDock1.TitlebarContainer.Controls.Add(lbl);  
    } 
WEBUSERCONTROL.ASCX:
<input type="button" value="ResizeDock" onclick="ResizeDock()" />


Tags
Dock
Asked by
Edan Evantal
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
Share this question
or