J
JimGreen
Hello All
I need some help in understanding some .NET behavior.
I created a collection class derived from CollectionBase and
IBindingList.
I bound a datagrid to the collection.
I added a button and on the click I called RemoveAt(0) . The grid gets
updated properly ( as I am firing ListChanged event from
OnRemoveComplete override of CollectionBase).
Next I created a thread and tried to call myColl.RemoveAt(0) from the
thread, I sometimes get an exception while the datagrid is tring to
paint. It seems as if the removal notice is received by Datagrid after
it tries to paint an item that was already removed .
I don't see any such problems if I says myColl.RemoveAt(
myColl.Count-1).
Any help would be appreciated.
I need some help in understanding some .NET behavior.
I created a collection class derived from CollectionBase and
IBindingList.
I bound a datagrid to the collection.
I added a button and on the click I called RemoveAt(0) . The grid gets
updated properly ( as I am firing ListChanged event from
OnRemoveComplete override of CollectionBase).
Next I created a thread and tried to call myColl.RemoveAt(0) from the
thread, I sometimes get an exception while the datagrid is tring to
paint. It seems as if the removal notice is received by Datagrid after
it tries to paint an item that was already removed .
I don't see any such problems if I says myColl.RemoveAt(
myColl.Count-1).
Any help would be appreciated.