This is a migrated thread and some comments may be shown as answers.

Object disposed while loading from XML

3 Answers 90 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Vipper
Top achievements
Rank 1
Vipper asked on 27 Nov 2013, 07:08 PM
Hi,
I had some issues trying to load different raddock's layouts containing distinct numbers of Tabbed Documents. This error always occurs on as specific situation, I'm gonna explain considering this two layouts:
LAYOUT1 = 4 Tabbed Documents
LAYOUT2 = 3 Tabbed Documents

First I load LAYOUT1 on my raddock and it creates 4 new Documents without errors. Then I load LAYOUT2 and apparently raddock re-use 3 opened documents and dispose one, that's ok. Finally, when I try to load LAYOUT1 again, I get a disposed object exception as below. I simulated this situation on Q2 2013 SP1 Examples (Dock\Serialization) and got same error (this example only uses ToolWindows, but when you dock the control filling the parent it becomes a Tabbed Document property). I really need that funcionality to by your product, thanks for your attention.

************** Exception **************
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'ToolWindow'.
   em System.Windows.Forms.Control.CreateHandle()
   em System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   em System.Windows.Forms.Control.CreateControl()
   em System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   em System.Windows.Forms.Control.set_Visible(Boolean value)
   em Telerik.WinControls.UI.TabPanel.set_Visible(Boolean value)
   em Telerik.WinControls.UI.TabStripPanel.SetSelected(TabPanel tabPanel)
   em Telerik.WinControls.UI.TabStripPanel.UpdateTabSelection(Boolean updateFocus)
   em Telerik.WinControls.UI.Docking.DockTabStrip.UpdateTabSelection(Boolean updateFocus)
   em Telerik.WinControls.UI.Docking.DocumentTabStrip.UpdateTabSelection(Boolean updateFocus)
   em Telerik.WinControls.UI.Docking.DockWindow.EnsureVisible()
   em Telerik.WinControls.UI.Docking.RadDock.UpdateActiveWindow(DockWindow window, Boolean forceNotify)
   em Telerik.WinControls.UI.Docking.RadDock.ActivateWindow(DockWindow window, Boolean forceNotify)
   em Telerik.WinControls.UI.Docking.RadDock.EnsureInitialized()
   em Telerik.WinControls.UI.Docking.RadDock.LoadDeserializedFloatingAndAutoHideWindows()
   em Telerik.WinControls.UI.Docking.RadDock.LoadFromNewXml(XmlReader reader)
   em Telerik.WinControls.UI.Docking.RadDock.LoadFromXmlCore(XmlReader reader, Boolean oldXmlFormat)
   em Telerik.WinControls.UI.Docking.RadDock.LoadFromXml(String fileName)
   em Telerik.Examples.WinControls.Docking.Serialization.Form1.radButton1_Click(Object sender, EventArgs e)
   em System.Windows.Forms.Control.OnClick(EventArgs e)
   em Telerik.WinControls.RadControl.OnClick(EventArgs e)
   em Telerik.WinControls.UI.RadButtonBase.buttonElement_Click(Object sender, EventArgs e)
   em Telerik.WinControls.RadItem.OnClick(EventArgs e)
   em Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
   em Telerik.WinControls.UI.RadButtonElement.OnClick(EventArgs e)
   em Telerik.WinControls.RadItem.DoClick(EventArgs e)
   em Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
   em Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
   em Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
   em Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
   em Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
   em Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
   em Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
   em System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   em System.Windows.Forms.Control.WndProc(Message& m)
   em System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   em Telerik.WinControls.RadControl.WndProc(Message& m)
   em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   em System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Assemblies **************
mscorlib
    Versão do Conjunto de Módulos (Assembly): 2.0.0.0
    Versão do Win32: 2.0.50727.5472 (Win7SP1GDR.050727-5400)
    Base de Código: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
TelerikExamples
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Program%20Files/Telerik/RadControls%20for%20WinForms%20Q2%202013/Examples/QuickStart/bin/TelerikExamples.exe
----------------------------------------
System.Windows.Forms
    Versão do Conjunto de Módulos (Assembly): 2.0.0.0
    Versão do Win32: 2.0.50727.5468 (Win7SP1GDR.050727-5400)
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Versão do Conjunto de Módulos (Assembly): 2.0.0.0
    Versão do Win32: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Versão do Conjunto de Módulos (Assembly): 2.0.0.0
    Versão do Win32: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
QuickStart
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/QuickStart/2013.2.724.20__5bb2a467cbec794e/QuickStart.dll
----------------------------------------
Telerik.WinControls.UI
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls.UI/2013.2.724.20__5bb2a467cbec794e/Telerik.WinControls.UI.dll
----------------------------------------
Telerik.WinControls
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls/2013.2.724.20__5bb2a467cbec794e/Telerik.WinControls.dll
----------------------------------------
TelerikCommon
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/TelerikCommon/2013.2.724.20__5bb2a467cbec794e/TelerikCommon.dll
----------------------------------------
System.Xml
    Versão do Conjunto de Módulos (Assembly): 2.0.0.0
    Versão do Win32: 2.0.50727.5476 (Win7SP1GDR.050727-5400)
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
    Versão do Conjunto de Módulos (Assembly): 2.0.0.0
    Versão do Win32: 2.0.50727.5476 (Win7SP1GDR.050727-5400)
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
sykqtklk
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Telerik.WinControls.Themes.Aqua
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls.Themes.Aqua/2013.2.724.20__5bb2a467cbec794e/Telerik.WinControls.Themes.Aqua.dll
----------------------------------------
Telerik.WinControls.Themes.Breeze
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls.Themes.Breeze/2013.2.724.20__5bb2a467cbec794e/Telerik.WinControls.Themes.Breeze.dll
----------------------------------------
Telerik.WinControls.Themes.Desert
    Versão do Conjunto de Módulos (Assembly): 2013.2.724.20
    Versão do Win32: 2013.2.724.20
    Base de Código: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls.Themes.Desert/2013.2.724.20__5bb2a467cbec794e/Telerik.WinControls.Themes.Desert.dll
----------------------------------------

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Dec 2013, 02:09 PM
Hello Vipper,

Thank you for contacting Telerik Support.

I confirm that this is an issue with our RadDock when loading/saving layout. I have logged it in our Public Issue Tracking System - PITS. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - PITS issue.

I have also updated your Telerik points

Currently, the possible workaround that I can propose is to remove all document windows in the RadDock before loading the layout:
radDock1.RemoveAllDocumentWindows();
radDock1.LoadFromXml(@"..\\..\\..\\layout1.xml");

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Denis
Top achievements
Rank 1
answered on 07 Jan 2015, 03:03 PM
Hi,

I'm also experiencing a similar issue. I would like to see the details of the PITS issue you linked, but that link doesn't get me to it. Perhaps the link is dead? Could you send me a link that would provide the details on the issue as well as it's status. I'd like to know if this has been fixed, and if so, in what release.

The workaround here did not help us with out issue.

Thank you,
Denis



0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Jan 2015, 03:15 PM
Hello Denis,

Thank you for writing.

Here is the feedback item for your reference. This issue was address in Q1 2014 SP1. Feel free to upgrade in order to benefit from the solution and all the introduced fixes.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Dock
Asked by
Vipper
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Denis
Top achievements
Rank 1
Share this question
or