Hi,
I currently have a page which has 8 docks spread between two docking zones. These are not dynamic and are coded into the page. My aim is to give the user the ability to save the position of the dock, it's collapse state and whether it viewable or not. everything works in that respect apart from one thing, the Index of the dock. I chose to use javascript (postbacks, update panels and web services were not an option) to save the state of the docks in a cookie when certain client side events fire, I then access this cookie on Page_Init and LoadDockLayout and apply to the relevant dock. when debugging in VS these events are hit and the information in the state is correct i.e. the index of the dock is the index that it should be. I have tried to manually set the index after calling ApplyState(), see below:
Unfortunately for some reason the Index of the dock gets over written somewhere along the line and when the page loads the docks are all correct in terms of state apart from the order in which they appear in the dock zone's. For some reason the Index I set in the code behind gets over written with the index that it is on the markup page, below is a cut down example:
In the code above if I were to set the index of RadDock8 to 0 and the index of RadDock9 to 1 it would load with RadDock9 with an index of 0 and Raddock8 with an index of 1. I have been through all the code and as already stated the correct index's are being passed and applied, but they just get over written somewhere and for some reason?
After looking at some other threads I can see that this was a bug in the past (http://www.telerik.com/community/forums/aspnet-ajax/docking/index-of-dockstate-not-persisting.aspx), has this been fixed now? Am I going about it the wrong way or missing something?
Regards
James
I currently have a page which has 8 docks spread between two docking zones. These are not dynamic and are coded into the page. My aim is to give the user the ability to save the position of the dock, it's collapse state and whether it viewable or not. everything works in that respect apart from one thing, the Index of the dock. I chose to use javascript (postbacks, update panels and web services were not an option) to save the state of the docks in a cookie when certain client side events fire, I then access this cookie on Page_Init and LoadDockLayout and apply to the relevant dock. when debugging in VS these events are hit and the information in the state is correct i.e. the index of the dock is the index that it should be. I have tried to manually set the index after calling ApplyState(), see below:
For Each dock As RadDock In RadDockLayout1.RegisteredDocks Dim uniqueName As String = dock.UniqueName Dim title As String = dock.Title Dim index As Integer = dock.Index Dim id As String = dock.ID If Not (uniqueName = "") Then Dim state As DockState = DockState.Deserialize(states(uniqueName).ToString()) dock.ApplyState(state) Dim iIndex As Integer = state.Index dock.Index = iIndex Dim zone As String = state.DockZoneID dock.DockZoneID = zone dock.UniqueName = uniqueName dock.Title = title dock.EnableAnimation = True dock.Width = Unit.Pixel(250) dock.EnableRoundedCorners = True dock.Style.Value = "margin-bottom: 10px !important;" End If NextUnfortunately for some reason the Index of the dock gets over written somewhere along the line and when the page loads the docks are all correct in terms of state apart from the order in which they appear in the dock zone's. For some reason the Index I set in the code behind gets over written with the index that it is on the markup page, below is a cut down example:
<telerik:RadDockZone ID="RadDockZone2" runat="server" Orientation="Vertical" Height="100%" > <telerik:RadDock ID="RadDock9" UniqueName="RadDock9" runat="server" Title="License Information" Width="250px" DockMode="Docked" EnableAnimation="true" EnableRoundedCorners="true" Resizable="true" OnClientInitialize="DockInit" OnClientDockPositionChanged="OnDockChange" OnClientCommand="OnClientCommand" Style="margin-bottom: 10px !important;"> <ContentTemplate> <uc8:license ID="license1" runat="server" /> </ContentTemplate> </telerik:RadDock> <telerik:RadDock ID="RadDock8" UniqueName="RadDock8" runat="server" Title="Sales Basket" Width="250px" DockMode="Docked" EnableAnimation="true" EnableRoundedCorners="true" OnClientInitialize="DockInit" OnClientDockPositionChanged="OnDockChange" OnClientCommand="OnClientCommand" Resizable="true" Style="margin-bottom: 10px !important;"> <ContentTemplate> <uc10:SalesBasket ID="SalesBasket" runat="server" /> </ContentTemplate> </telerik:RadDock></<telerik:RadDockZone>In the code above if I were to set the index of RadDock8 to 0 and the index of RadDock9 to 1 it would load with RadDock9 with an index of 0 and Raddock8 with an index of 1. I have been through all the code and as already stated the correct index's are being passed and applied, but they just get over written somewhere and for some reason?
After looking at some other threads I can see that this was a bug in the past (http://www.telerik.com/community/forums/aspnet-ajax/docking/index-of-dockstate-not-persisting.aspx), has this been fixed now? Am I going about it the wrong way or missing something?
Regards
James