6 Answers, 1 is accepted
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 30 Sep 2008, 02:31 PM
You can handle the ClientResizeEnd client-side event and create an ajax call with javascript which will save the state on the server.
Hope this helps.
Hope this helps.
0
Todd
Top achievements
Rank 1
answered on 30 Sep 2008, 04:46 PM
Thanks for your reply.
I do not know javascript.
Do you have an example of how this would be done?
I do not know javascript.
Do you have an example of how this would be done?
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 01 Oct 2008, 03:10 PM
The easiest approach is to add a button to the page with style="display:none" and click it via Javascript when the ResizeEnd event occurs,e.g.
ASPX:
In the Button_Click handler(on the server) you should add you logic which will save the state,
ASPX:
<%@ 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 runat="server"> |
<title>Untitled Page</title> |
<script type="text/javascript"> |
function DockResizeEnd(obj,args) |
{ |
$get("MyButton").click(); |
} |
</script> |
</head> |
<body> |
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> |
<div> |
<telerik:raddocklayout runat="server" id="RadDockLayout1"> |
<telerik:RadDock ID="RadDock1" runat="server" Title="RadDock1" |
Resizable="true" |
OnClientResizeEnd="DockResizeEnd"> |
</telerik:RadDock> |
</telerik:raddocklayout> |
<asp:Button ID="MyButton" runat="server" Text="SaveStateOnServer" style="display:none" OnClick="MyButton_Click"/> |
</div> |
</form> |
</body> |
</html> |
0
Todd
Top achievements
Rank 1
answered on 01 Oct 2008, 07:13 PM
Thank you for your reply.
Although this does work it causes a post back because of the button being clicked. Is there a way to do it without postback?
I wonder why something like this was not coded into the control, seems like you would always want to save the layout after a dock is resized.
Although this does work it causes a post back because of the button being clicked. Is there a way to do it without postback?
I wonder why something like this was not coded into the control, seems like you would always want to save the layout after a dock is resized.
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 02 Oct 2008, 12:50 PM
You can use RadDock's doPostBack client-side method ,e.g.
<
script type="text/javascript">
function DockResizeEnd(dockObj,args)
{
dockObj.doPostBack('DockPositionChanged');
}
</script>
0
Todd
Top achievements
Rank 1
answered on 02 Oct 2008, 01:03 PM
That works perfectly.
Thanks for your help.
Thanks for your help.