Docking Save/Load removing all items

Topics related to the Krypton Docking.

Moderators: Phil Wright, Chris Porter

Docking Save/Load removing all items

Postby otherjcsys » Tue Jul 27, 2010 1:04 pm

Using the following code based on the examples for docking:

KryptonDockingWorkspace w = kryptonDockingManager1.ManageWorkspace(kryptonDockableWorkspace1);

kryptonDockingManager1.ManageControl(kryptonPanel1, w);
kryptonDockingManager1.ManageFloating(this);

// Add initial docking pages
kryptonDockingManager1.AddToWorkspace("Workspace", new KryptonPage[] { OrdersDocument(), VehiclesDocument(), MapDocument() });

I am able to start with three tabbed "documents". I then rearrange them as shown in the attachment:

Layout.gif
Layout.gif (4.53 KiB) Viewed 859 times


Then, clicking a button on the form, I call this code:

kryptonDockingManager1.SaveConfigToFile("test.txt");

This creates a file as expected.

Clicking another button, I call this code:

kryptonDockingManager1.LoadConfigFromFile("test.txt");

No problems, the interface doesn't change as expected (I didn't rearrange anything).

Now, quit the program and re-run it. The the documents are there, tabbed in a single row.

Next click the button to load the config from file (which we want to reposition everything like we had in the attached image). Poof. All the "documents" are gone. I now have a blank workspace.

Thoughts?
otherjcsys
 
Posts: 3
Joined: Tue Jul 27, 2010 8:47 am

Re: Docking Save/Load removing all items

Postby otherjcsys » Tue Jul 27, 2010 1:17 pm

Ok, I thought about it and said, heck I can build a sample case really quick and I'll be it will help to review it. So, attached is the sample project.

Now I don't have to worry about having left out a key point (like the fact I was using a RibbonForm).

DockingProblem.zip
(66.31 KiB) Downloaded 10 times
otherjcsys
 
Posts: 3
Joined: Tue Jul 27, 2010 8:47 am

Re: Docking Save/Load removing all items

Postby otherjcsys » Wed Jul 28, 2010 1:28 am

Ok, I found it.

When creating your KryptonPage you must set the UniqueName property. My guess is this is how it finds the pages to reposition them.

All the docking seems to work just fine without this property except for persistence.

PS - It would really be helpful if you had a designer for docking. Creating the dock from code isn't hard but getting the layout you want to start with is not always possible with the code approach.
otherjcsys
 
Posts: 3
Joined: Tue Jul 27, 2010 8:47 am

Re: Docking Save/Load removing all items

Postby Phil Wright » Thu Aug 05, 2010 2:19 pm

Your right, the UniqueName is used so it can match up the loading config with the existing page. Without this it has no way to know which config relates to which existing page. There is no plan on adding a designer for the docking.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia


Return to Krypton Docking

Who is online

Users browsing this forum: No registered users and 1 guest

cron