Constantly Updating List ... DataGridView or ListView

G

Guest

Hi All,

I want to bind a datagridview or ListView to a List that is constantly
being updated (items are added/removed all the time).

Any ideas what the best way is to do this? I tried binding the collection
directly to the grid but occasionally I'll get cross thread errors
(different threads updating the collection).

Is there a way to get a live view of an array/list easily?

Thanks!
 
Z

zacks

Hi All,

I want to bind a datagridview or ListView to a List that is constantly
being updated (items are added/removed all the time).

Any ideas what the best way is to do this? I tried binding the collection
directly to the grid but occasionally I'll get cross thread errors
(different threads updating the collection).

Is there a way to get a live view of an array/list easily?

Thanks!

I've never done it but I understand that you can overload a method in
a .NET class. So you should be able to write your own .Add method for
the List. In your .Add method, invoke the standard.Add method to add
the item, and then re-populate the form control(s).
 
G

Guest

(e-mail address removed) wrote in 50g2000hsm.googlegroups.com:
I've never done it but I understand that you can overload a method in
a .NET class. So you should be able to write your own .Add method for
the List. In your .Add method, invoke the standard.Add method to add
the item, and then re-populate the form control(s).

Yes, but if the .add is called from a different thread, you'll get a cross
thread error.

Also I don't have access to the DataGridView from inside the collection.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top