RadDock loads non-existing controls

4 posts, 0 answers
  1. Chris Vrolijk
    Chris Vrolijk avatar
    5 posts
    Member since:
    Feb 2009

    Posted 26 Oct 2015 Link to this post

    We have a problem using the radDock.LoadFromXml() and radDock.SaveToXml() functionality. This is the case:

     1. We created an application some time ago, version 1.0. This application uses radDock.LoadFromXml() and radDock.SaveToXml() to save and restore the window settings.

    2. We added new windows to this application in version 2.0.

    3. People do use the original application (next to the new one) though, resulting in showing windows that do not exist in version 1.0 (!)

    Is there a way to repair this? I know I can save and load the settings in a different file, but I am looking for a better solution (since we will have more new versions of our application).

     

  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 27 Oct 2015 Link to this post

    Hi Chris,

    Thank you for writing.

    RadDock does not have any built-in functionality for handling such scenarios. Using separate files for the different versions is actually a good solution because you will be able to determine for which version the loaded file is. For example, you can add the version to the filename which will allow you to distinguish the layout files.

    I hope this helps. Should you have any other questions do not hesitate to ask.
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Chris Vrolijk
    Chris Vrolijk avatar
    5 posts
    Member since:
    Feb 2009

    Posted 27 Oct 2015 Link to this post

    Hi Dimitar,

     

    Thanks for your quick response.

    Regarding 3. in my first post:

    - I conclude that the windows are created dynamically using the xml file, and no check is performed whether these windows actually exist in code. Can you confirm that?

    - If so, is there a way to override the process of building the windows? That would enable me to add the check or other behavior myself.

    We want to avoid remembering separate settings for the parallel versions. This is considered as annoying to our users. Instead, these must be shared by different versions of our application.

     Regards,

    Chris

     

     

  5. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 27 Oct 2015 Link to this post

    Hi Chris,

    Thank you for writing back.

    Yes, you are correct, the windows are created according to the layout saved in the XML file. You can use the DockWindowAdded event to close some of the windows or perform another action:
    void radDock1_DockWindowAdded(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
    {
        if (e.DockWindow.Name == "toolWindow2")
        {
            e.DockWindow.Close();
        }
    }

    In addition, you can use SavedToXml and LoadedFromXml events as well.

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top