Save/Load Layout --> Problem

Topics related to the Krypton Workspace.

Moderators: Phil Wright, Chris Porter

Save/Load Layout --> Problem

Postby matthiask2 » Fri Nov 20, 2009 9:23 pm

Hello!

I use the Krypton.Workspace (4.0 Version) and i have expirienced a strange problem.

when i use the SaveLayoutToFile() method, and my Workspace is currently not visible, then the layout elements (pages) are saved with the attribute v="false".
This causes the LoadLayoutFromFile() method to not load anything from the file at all --> no page is loaded into the workspace and the workspace appears empty!

Is there any attribute which i have to set before saving in order to prevent the SaveLayoutToFile() method to save the v="false" attribute?

By the way: when the Workspace is visible then the Saving and Loading of the Layout works just fine!

I would appreciate any suggestions!

Best regards,
Matthias
matthiask2
 
Posts: 2
Joined: Fri Nov 20, 2009 8:34 pm

Re: Save/Load Layout --> Problem

Postby Phil Wright » Sat Nov 21, 2009 12:32 pm

You can get around this by hooking into the KryptonWorkspace.PageLoading event. This is called when the predefined values such as page visibility have already been loaded. So inside the event you can override the value and set it to True.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia

Re: Save/Load Layout --> Problem

Postby matthiask2 » Mon Nov 23, 2009 7:41 pm

Hi Phil!

Thanks for your reply!

I've tried to use the PageLoading event, and set e.Page.Visible = true; in the eventmethod --> but still there is just an empty cell displayed in my workspace on startup

Do you have further suggestions?
Am I doing something wrong?

Best regards,
Matthias
matthiask2
 
Posts: 2
Joined: Fri Nov 20, 2009 8:34 pm

Re: Save/Load Layout --> Problem

Postby Phil Wright » Thu Nov 26, 2009 12:15 pm

On further investigation I think this is a bug in the code. When each page is saved it saves the KryptonPage.Visible state and if the whole control is not visible then it returns false. In practice we do not want to save false unless the page itself has been asked to be hidden. So I have updated the save to use the last value set to the KryptonPage.Visible. This then works in the expected way. This fix will be in the next release.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia


Return to Krypton Workspace

Who is online

Users browsing this forum: No registered users and 0 guests