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

sub dock manger / panels

1 Answer 60 Views
Dock
This is a migrated thread and some comments may be shown as answers.
B
Top achievements
Rank 1
B asked on 06 May 2008, 03:20 PM
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.

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 07 May 2008, 03:55 PM
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
Tags
Dock
Asked by
B
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or