or



I have gotten items 1-4 working fine - the positioning of dock zones remains stable and predictable between post-backs. However, I am having trouble getting #5 to work reliably. Among the symptoms I see:
Some details: as emphasized by the vast majority of documentation, it is best to create/re-create everything in Page_Init. Thus, I have:
| protected void Page_Init(object sender, EventArgs e) |
| { |
| // Re-create tabs (from persistence store) on the first page visit only |
| if (!Page.IsPostBack) |
| { |
| for (int i = 0; i < CurrentTabCollection.Count; i++) { } |
| } |
| // Re-create page views |
| foreach (KeyValuePair<string, int> pageViewTuple in CurrentPageViewIdCollection) { CreateNewPageView(pageViewTuple.Key, pageViewTuple.Value); } |
| // Re-create dock layouts |
| foreach (KeyValuePair<string, int> dockLayoutTuple in CurrentDockLayoutIdCollection) { CreateNewDockLayout(dockLayoutTuple.Key, dockLayoutTuple.Value); } |
| // Re-create dock zones |
| foreach (KeyValuePair<string, string> dockZoneTuple in CurrentDockZoneIdCollection) { CreateNewRadDockZone(dockZoneTuple.Key, dockZoneTuple.Value); } |
| // Re-create docks |
| for (int i = 0; i < CurrentDockStateCollection.Count; i++) |
| { |
| RadDock dock = CreateRadDockFromState(CurrentDockStateCollection[i]); |
| CreateSaveStateTrigger(dock); |
| } |
| } |
| private void CreateNewDockLayout(string dockLayoutId, int parentTabIndex) |
| { |
| var newDockLayout = new RadDockLayout { ID = dockLayoutId }; |
| newDockLayout.SaveDockLayout += FormSectionsRadDockLayout_SaveDockLayout; // Assign dock layout save handler |
| newDockLayout.LoadDockLayout += FormSectionsRadDockLayout_LoadDockLayout; // Assign dock layout load handler |
| FormSectionsRadMultiPage.PageViews[parentTabIndex].Controls.Add(newDockLayout); |
| } |
| protected void FormSectionsRadDockLayout_SaveDockLayout(object sender, DockLayoutEventArgs e) |
| { |
| // Save the dock state in session |
| CurrentDockStateCollection = ((RadDockLayout)sender).GetRegisteredDocksState(); |
| } |
| protected void FormSectionsRadDockLayout_LoadDockLayout(object sender, DockLayoutEventArgs e) |
| { |
| // Populate event args with state information; the RadDockLayout control will automatically move the docks according to this information |
| foreach (DockState state in CurrentDockStateCollection) |
| { |
| e.Positions[state.UniqueName] = state.DockZoneID; |
| e.Indices[state.UniqueName] = state.Index; |
| } |
| } |
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [ProductID], [ProductName], [ProductPrice], [PicName], [ModifiedDate] FROM [Products] WHERE ([UserID] = @UserID)"><SelectParameters><asp:SessionParameter Name="UserID" SessionField="LoginID" Type="Int32" DefaultValue="1" /></SelectParameters></asp:SqlDataSource>