I do have try catch blocks in the two main procedures that get called to do
the executing and spawning of threads, I'm just wondering where else I could
put them? Should I somehow overload the paint method to do this?
> Hi,
>
[quoted text clipped - 22 lines]
> Thanks,
> Ben
How is this a bug in the datagrid? Most likely the problem is that the fact
that Ben is updating the DataTable that the DataGrid is bound to and
therefore manipulating the DataGrid (albeit indirectly) from the background
thread since changing the DataTable will cause the grid's bindingmanager to
be raise notifications (ListChanged, etc.) to its listeners which includes
the datagrid and these notifications will occur on the background thread
since that is what he is manipulating the datatable from. I think the real
answer is to not manipulate the datatable that the datagrid is bound to from
the background thread; instead, either manipulate a copy or update a
different datatable and upon completion, marshal a call onto the ui thread
(using the datagrid's or some other control's Invoke/BeginInvoke method) and
replace or merge the changes into the datatable that the datagrid is bound
to.
> Hi,
>
[quoted text clipped - 19 lines]
> Thanks,
> Ben
Miha Markic [MVP C#] - 29 Nov 2004 08:15 GMT
Hi Andrew,
Yes, this is what I think, too.
One should never ever touch UI controls from within non-UI (the thread that
created them, usually the main thread) thread.
A good article on the topic:
Safe, Simple Multithreading in Windows Forms, part 3, MSDN Online, January,
2003
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/wi
nforms01232003.asp

Signature
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com
"Andrew Smith (Infragistics)" <productmanager@infragistics.com> wrote in
message news:e4mv8gM1EHA.2112@TK2MSFTNGP15.phx.gbl...
> How is this a bug in the datagrid? Most likely the problem is that the
> fact
[quoted text clipped - 45 lines]
>> Thanks,
>> Ben