Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
UltraDockManager - Loading Invalid Dock Layout Crashes Application
posted

I'm using UltraDockManager to manage docking layouts for my application. It seems that the docking file got corrupted or save incorrectly and the dock manager cannot import the file now.

              try
              {
                 if (File.Exists(_fractionDockLayout) == true)
                     dockManager.LoadFromXML(_fractionDockLayout);
                }
                catch(Exception ex)
                {
                    Logging.Logger.Warning("Error loading the fractions docking layout: " + ex.Message);
                }

Even with the LoadFromXml call inside a try/catch block with a generic exception handler, the application crashes as soon as the LoadFromXML line is run. Turning on exception breaking in Visual Studio, I can see that the error is "System.ArgumentException: Height must be greater than 0px.'

We are using WinForms, Infragistics 2017.1, targeting .NET 4.0

How can I recover gracefully from this situation so my application can still run without having to go manually delete the layout XML file?

Parents
  • 25665
    Offline posted

    Hello Daniel,

    Thank you for contacting Infragistics!

    Currently there isn’t a way to recover the layout xml file. Can you attach your sample so it can be looked into why this is failing and throwing the exception?

Reply
  • 155
    Offline posted in reply to Michael Peterson

    FractionsDockLayout.zip

    Mike, thank you for the response. It's okay if I'm unable to recover the saved layout. I just need a way to handle the exception gracefully so my software doesn't crash if the layout is invalid. Is there a way to check the validity of a layout before calling LoadFromXml? I've attached the XML layout - hopefully it is useful for determining where the failure is occurring.

Children