471,337 Members | 851 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Multithreading with TreeView and ListView controls


I have an application that uses TreeView and ListView just like Windows
Explorer or Outlook. You click on a tree node and the list is filled up
with corresponding elements.

My list results come from a (remoting) server, and processing is done in
several layers. Now I would like to do this in a multithreaded scenario,
i.e. fetching the list results in the background and then update the
list. I have consulted all the pertinent sources for this on the net,
and it works (relatively) fine so far.

My question is: if the user clicks a different tree node while a fetch
operation is in progress, I would like to stop the worker thread. Or at
least wait for it to be finished, as, for example, SQLReader exceptions
tend to occur when rampantly clicking on nodes. I tried to keep my
separate thread in a static field and return it through something like

internal static Thread ListLoadWorker {
get {
if( _listLoadWorker != null && _listLoadWorker.ThreadState !=
ThreadState.Unstarted ){
return _listLoadWorker;
/*bla bla*/

It just won't come to the point where I could wait for a previous thread
to be finished. What am I missing here?

Best regards, Helge
Aug 18 '05 #1
0 944

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by fgh | last post: by
1 post views Thread by paradox | last post: by
4 posts views Thread by Ben Coats | last post: by
reply views Thread by Helge Lenuweit | last post: by
6 posts views Thread by Beginner | last post: by
1 post views Thread by =?Utf-8?B?QW5kcmV3?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.