M
Marcus Watts
OK, bit of a problem.
I have a MDI Child form that calls another child form (using the
MdiParent = me.MdiParent method). This successfully adds in the new
(grand) child form into the Windows menu, but when I try to close the
grandchild form, I get a Windows Error:
"System.InvalidCastException: Specified cast is not valid.
at System.Data.DataColumnPropertyDescriptor.GetValue(Object
component)
at
System.Windows.Forms.DataGridColumnStyle.GetColumnValueAtRow(CurrencyMan
ager source, Int32 rowNum)
at System.Windows.Forms.DataGridTextBoxColumn.Edit(CurrencyManager
source, Int32 rowNum, Rectangle bounds, Boolean readOnly, String
instantText, Boolean cellIsVisible)
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocusedControl()"
The child form uses a datagrid control (bound to SQL Servr backend), and
the grandchild uses one of the records from the datagrid to display, and
edit the details of the datagrid entry.
If I don't make the grandchild a child form, then I don't get this error
at all. Any ideas?
Thanks
I have a MDI Child form that calls another child form (using the
MdiParent = me.MdiParent method). This successfully adds in the new
(grand) child form into the Windows menu, but when I try to close the
grandchild form, I get a Windows Error:
"System.InvalidCastException: Specified cast is not valid.
at System.Data.DataColumnPropertyDescriptor.GetValue(Object
component)
at
System.Windows.Forms.DataGridColumnStyle.GetColumnValueAtRow(CurrencyMan
ager source, Int32 rowNum)
at System.Windows.Forms.DataGridTextBoxColumn.Edit(CurrencyManager
source, Int32 rowNum, Rectangle bounds, Boolean readOnly, String
instantText, Boolean cellIsVisible)
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocusedControl()"
The child form uses a datagrid control (bound to SQL Servr backend), and
the grandchild uses one of the records from the datagrid to display, and
edit the details of the datagrid entry.
If I don't make the grandchild a child form, then I don't get this error
at all. Any ideas?
Thanks