C
consumer62000
I am trying to decompile datagrid. Here is my problem
I want to know when does the datagrid create (subscribe to) the handler
of ListChanged event.
I have my own collection attached to the datagrid and I want to remove
an item from the bound collection from a backend thread. But when I do
that I get the following error( see at the end of this message )
I believe I can prevent this problem if I somehow marshal the call to
the control containing the grid. Remember I am tring to remove an
object from the collection in the backend thread in the business object
and I don't have access to the user interface thread.
2 questions
1. How can I fix the problem?
2. Where in datagrid is the ListChanged handler coded. I used Anakrino
to decompile the code.
Thanks
=============================================================
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IndexOutOfRangeException: No value at index 9.
at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
at System.Windows.Forms.DataGridRow.PaintHeader(Graphics g,
Rectangle visualBounds, Boolean alignToRight, Boolean rowIsDirty)
at
System.Windows.Forms.DataGridRelationshipRow.PaintHeaderInside(Graphics
g, Rectangle bounds, Brush backBr, Boolean alignToRight, Boolean
isDirty)
at System.Windows.Forms.DataGridRelationshipRow.PaintHeader(Graphics
g, Rectangle bounds, Boolean alignToRight, Boolean isDirty)
at System.Windows.Forms.DataGrid.PaintRows(Graphics g, Rectangle&
boundingRect)
at System.Windows.Forms.DataGrid.PaintGrid(Graphics g, Rectangle
gridBounds)
at System.Windows.Forms.DataGrid.OnPaint(PaintEventArgs pe)
at
System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
I want to know when does the datagrid create (subscribe to) the handler
of ListChanged event.
I have my own collection attached to the datagrid and I want to remove
an item from the bound collection from a backend thread. But when I do
that I get the following error( see at the end of this message )
I believe I can prevent this problem if I somehow marshal the call to
the control containing the grid. Remember I am tring to remove an
object from the collection in the backend thread in the business object
and I don't have access to the user interface thread.
2 questions
1. How can I fix the problem?
2. Where in datagrid is the ListChanged handler coded. I used Anakrino
to decompile the code.
Thanks
=============================================================
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IndexOutOfRangeException: No value at index 9.
at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
at System.Windows.Forms.DataGridRow.PaintHeader(Graphics g,
Rectangle visualBounds, Boolean alignToRight, Boolean rowIsDirty)
at
System.Windows.Forms.DataGridRelationshipRow.PaintHeaderInside(Graphics
g, Rectangle bounds, Brush backBr, Boolean alignToRight, Boolean
isDirty)
at System.Windows.Forms.DataGridRelationshipRow.PaintHeader(Graphics
g, Rectangle bounds, Boolean alignToRight, Boolean isDirty)
at System.Windows.Forms.DataGrid.PaintRows(Graphics g, Rectangle&
boundingRect)
at System.Windows.Forms.DataGrid.PaintGrid(Graphics g, Rectangle
gridBounds)
at System.Windows.Forms.DataGrid.OnPaint(PaintEventArgs pe)
at
System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)