Selecting an item in a Listview programmatically

  • Thread starter Thread starter Jin Kim
  • Start date Start date
J

Jin Kim

Hi all,

I'm trying to select an item in a listview using C#
and .NET Compact Framework. Is there anyway to do this
by passing in the index of the item I want selected?
I've tried

listView.Items(index).selected = true;

the compiler returns

(268): 'System.Windows.Forms.ListView.Items' denotes
a 'property' where a 'method' was expected

Thanks,
Jin
 
The semicolon incidates C#, so shouldn't it be:

listView.Items[index].Selected = true;
 
Back
Top