none
Updating a ListView dynamically... How? RRS feed

  • Question

  • I have a listview in a form that I'm needing to do dynamic updates with.  Adding information to the Listview when initializing it works great.  What I was concerned with is updating the information on a row/column basis or somehow passing a collection from left to right of the information I want to update in each row.

    I didn't see any "update" method, just the Add and AddRange.  Do I need to get the ListItem from the list and re-Add all the values and then do some kind of DoEvents to allow it to update?  I would be great if the screen didn't flicker as well when updating...

     

    So, If I've got three processing threads running each tied to a particular ListItem, how do I continue to update the values I'm getting back from the processing threads so the visual indicator works... lets say something like a bytecount (one of the fields in this case).  It looks to me I have to do Adds over and over or somethign like that...

    How is this done?

     

    Thanks,

    D

    Thursday, March 15, 2007 7:27 PM

Answers

  • You can refer to existing items by using int index or key index on Items collection, for example

    listView1.Items[2].Text = "New text";

    Thursday, March 15, 2007 7:59 PM