ListView: under the hood...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a question about how ListView works. I have a data structure of
several hundred records which I have used to fill up a ListView. Now, I
figured the ListView would take references to my data, but instead it looks
like it actually copies my data. I am assuming this, because when I alter
data in my original data structure, the data on the ListView does not change,
it retains the old data.

Two concerns of mine are:

Isn't this serious 'bloatware', to have a ListView just copy everything
instead of keeping references?

How then can I gracefully update data in my ListView whenever I alter
something in the original data?

Thanks for your time!
 
It sounds to me as though you should be using databinding to populate your
listview although that is a pretty limited solution unless you derive from
the ListView class ans do custom drawing.

Maybe your data could be displayed better using a datagrid bound to a
dataset containing your information.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
 
Back
Top