sub dock manger / panels

2 posts, 0 answers
  1. B
    B avatar
    16 posts
    Member since:
    Jan 2008

    Posted 06 May 2008 Link to this post

    I am having an odd problem with the Dock manager.

    I created a project similiar to the Dock for MDI example.

    My version loads a form which also includes another dock manager.

    This works fine and looks awesome! but, for some reason, if I close the document that contains the sub dockmanager, and then I close my application, I get this error:

    System.ArgumentException  {"Parameter is not valid."}  
     
    "   at System.Drawing.Font.GetHeight(Graphics graphics)\r\n   at System.Drawing.Font.GetHeight()\r\n   at System.Drawing.Font.get_Height()\r\n   at Telerik.WinControls.VisualElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.RadItem.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.UI.LightVisualElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.UI.GridRowElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.RadObject.UpdateEffectiveValue(RadProperty dp, RadPropertyMetadata metadata, Boolean isCoerceValue, Boolean isOldValueValid, Object oldValue, ValueSource oldValueSource, Boolean oldValueIsDeferred, Boolean coerceWithDeferredReference)\r\n   at Telerik.WinControls.RadObject.NotifyOnPropertyChanged(RadProperty radProperty, Object oldValue)\r\n   at Telerik.WinControls.RadObject.UnregisterStylePropertySetting(IPropertySetting setting, Boolean notifyPropertyChange)\r\n   at Telerik.WinControls.PropertySetting.UnregisterValue(RadElement element)\r\n   at Telerik.WinControls.SelectorBase.Unregister(RadElement element, PropertySettingCollection propertySettings)\r\n   at Telerik.WinControls.StyleSheet.Unapply(RadElement radElement)\r\n   at Telerik.WinControls.RadElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.VisualElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.RadItem.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.UI.LightVisualElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.UI.GridRowElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.RadObject.UpdateEffectiveValue(RadProperty dp, RadPropertyMetadata metadata, Boolean isCoerceValue, Boolean isOldValueValid, Object oldValue, ValueSource oldValueSource, Boolean oldValueIsDeferred, Boolean coerceWithDeferredReference)\r\n   at Telerik.WinControls.RadObject.SetValueCommon(RadProperty dp, Object value, RadPropertyMetadata metadata, Boolean coerceWithDeferredReference)\r\n   at Telerik.WinControls.RadObject.SetValue(RadProperty dp, Object value)\r\n   at Telerik.WinControls.RadElement.set_Style(StyleSheet value)\r\n   at Telerik.WinControls.UI.GridRowElement.Dispose(Boolean disposing)\r\n   at Telerik.WinControls.RadComponentElement.Dispose()\r\n   at Telerik.WinControls.RadElement.Cleanup()\r\n   at Telerik.WinControls.ComponentThemableElementTree.RemoveChildren(RadElement element)\r\n   at Telerik.WinControls.ComponentThemableElementTree.RemoveChildren(RadElement element)\r\n   at Telerik.WinControls.ComponentThemableElementTree.RemoveChildren(RadElement element)\r\n   at Telerik.WinControls.ComponentThemableElementTree.RemoveChildren(RadElement element)\r\n   at Telerik.WinControls.ComponentThemableElementTree.Dispose(Boolean disposing)\r\n   at Telerik.WinControls.RadControl.Dispose(Boolean disposing)\r\n   at Telerik.WinControls.UI.RadGridView.Dispose(Boolean disposing)\r\n   at System.ComponentModel.Component.Dispose()\r\n   at System.Windows.Forms.Control.Dispose(Boolean disposing)\r\n   at Telerik.WinControls.Docking.DockWindow.Dispose(Boolean disposing)\r\n   at System.ComponentModel.Component.Dispose()\r\n   at System.Windows.Forms.Control.Dispose(Boolean disposing)\r\n   at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)\r\n   at Telerik.WinControls.Docking.DockSite.Dispose(Boolean disposing)\r\n   at System.ComponentModel.Component.Dispose()\r\n   at Telerik.WinControls.Docking.DockingManager.Dispose(Boolean disposing)\r\n   at System.ComponentModel.Component.Finalize()" 

    If I dont close any of the documents and just close the application, I dont get this error.


    I am not sure what the actual cause is... There isnt much code going on, just alot of layout stuff.

    There is a grid which is inside sub form / dockmanager.  I can see it mentions something about it in the error but I just cant figure it out, something about styling.

  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 07 May 2008 Link to this post

    Hello Brian,

    Thank you for writing.

    I have managed to reproduce this issue locally. The reason for it is incorrect disposing of RadGridView when disposing a DockingManager containing it. We will investigate this carefully and we will try to address it in our upcoming Q1 2008 Service Pack 1.

    Currently, you could try to force a disposal of RadGridView in the Disposed event of the DockingManager. Please review the code-block below:

    private void Form1_Load(object sender, EventArgs e)  
    {  
        this.dockingManager1.Disposed += new EventHandler(dockingManager1_Disposed);  
    }  
     
    void dockingManager1_Disposed(object sender, EventArgs e)  
    {  
       this.radGridView1.Dispose();  

    Unfortunately, I cannot guarantee that above suggestion will work in all scenarios.

    I am sorry for the inconvenience this issue has caused you. If you have other questions, do not hesitate to contact me again. 

    Kind regards,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top