We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Persisting layout of programmatically docked windows

Thread ID:





45505 Jun 22,2006 10:56 AM UTC Aug 9,2006 07:39 PM UTC WinForms 8
Tags: Tools
Daniele Fusi
Asked On June 22, 2006 10:56 AM UTC

Hi, I''m trying to persist the layout of an application using your latest library version (4.2) but I cannot manage to let it work. This application is structured as follows: - in the main form designer I''ve just a docking manager and a docking client panel sized to fit the whole form. - all the windows are docked programmatically in the form Load event, like e.g.: // create and dock a window named _frmMovies _frmMovies = new FrmMovies(); _frmMovies.TopLevel = false; _frmMovies.FormBorderStyle = FormBorderStyle.None; _dockMgr.DockControl(_frmMovies, this, DockingStyle.Left, _frmMovies.Width); // (...icon, label and min size are set too...) - the view menu allows users to toggle the visibility of docked windows: there is a menu item for each docked window, which can be checked or not. When it''s checked I call _dockMgr.SetDockVisibility. I also handle the DockVisibilityChanged event so that if the user closes a docked window the checkmarks in the corresponding menu is kept in synch. In this scenario NewDockStateEndLoad is never fired, anyway I tried loading the persisted state at the end of the form Load handler and saving it on form''s Closing handler, with a code like this: ---LOAD--- string sFile = GetDockStateFile(); if (File.Exists(sFile + ".xml")) { AppStateSerializer ser = new AppStateSerializer(SerializeMode.XMLFile, sFile); _dockMgr.LoadDockState(ser); } ---SAVE--- AppStateSerializer ser = new AppStateSerializer(SerializeMode.XMLFile, GetDockStateFile()); _dockMgr.SaveDockState(ser); ser.PersistNow(); This saves an XML file with docking state, but when the file with persisted data is loaded it just scrambles up the whole interface: no docked window is shown, menu checkmarks are all on, and if I try playing with the UI the dock manager raises exceptions. What''s the correct way of persisting the state of such an application? Thank you

Joy K George [Syncfusion]
Replied On June 22, 2006 04:09 PM UTC

Hi Daniele, We regret for the inconvenience caused. I was not able to reproduce the issue here.The sample which I used for testing is attached here.Please modify that to bring the issue. It would be helpful, if you send the stack trace of exception which you got. Thanks for choosing Syncfusion products. Regards, Joy


Daniele Fusi
Replied On June 22, 2006 07:18 PM UTC

Thank you, I''ve created a new application from scratch; it does not crash the docking manager as it happens on my real world app, even if both are structured in this way, but it does not fully restore the layout (e.g. the main window size).


Joy K George [Syncfusion]
Replied On June 23, 2006 07:17 PM UTC

Hi Daniele, DockingManager''s layout persistence mechanism is supposed to persist the dockstate of controls docked that layout.It wont persist the Size and Location of your main window. If you want to persist properties of your main form you may use app.config file. Please let me know,if you need more assistance. Regards, Joy

Daniele Fusi
Replied On June 24, 2006 09:29 AM UTC

Thank you, I''m going to open a direct-trac issue as this does not seem to work; I''ve added code for restoring window size, and this works, but the layout of the docked windows comes out completely scrambled (see the images: snap3 is as the application without restoring docking state, snap2 after resizing & restoring it: even the toolbars are "cut" and all the view items are checked but no pane is visible).

Daniele Fusi
Replied On June 24, 2006 09:31 AM UTC

Sorry, I had forgotten to attach the images...


Joy K George [Syncfusion]
Replied On June 26, 2006 08:50 PM UTC

Hi Daniele I was able to reproduce the issue and updated incident 26423.Please take a look into that. Regards, Joy

Hugh Potts
Replied On August 8, 2006 07:16 PM UTC

I''d like to see the information available in incident 26423. Can you tell me how to access an incident using its incident ID, or otherwise give me access to the contents of the incident?

Joy K George [Syncfusion]
Replied On August 9, 2006 07:39 PM UTC

Hi Hugh,

The issue was related to dockstate persistence.

"If we save and load a dockstate which contains some invisible controls ,an assertion issue will raise".

We have fixed that and currently in testing phase.

Please let me know,if you need more information regarding this.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon