List Info

Thread: Getting to know the ListView VirtualMode




Getting to know the ListView VirtualMode
user name
2006-07-11 15:12:26
>1) My app has a ComboBox and a ListView. The ComboBox
determines what
kind of data is shown in the ListView. When the user changes
the ComboBox,
how can code inform the ListView that all the visible items
need to be
refetched (because the content is being replaced)?

You just need to force a repaint, which can be done by
calling in the
Invalidate() method on the ListView control.

>
>2) How can code select a virtual item in the ListView?

listView1.Items[i].Selected = true;

If you want to have the current item change as well:
listView.Items[i].Focused = true;

-- Peter
Microsoft MVP, Visual Developer - Visual C#
http://www.peterRit
chie.com/blog/
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )