I have a list view in windows forms. _listView1
.
I wish to programatically select an item in the listview.
I say _listView1.Items[i].Select=true;
But that doesn't solve the problem. The item doesn't get selected.
I have a list view in windows forms. _listView1
.
I wish to programatically select an item in the listview.
I say _listView1.Items[i].Select=true;
But that doesn't solve the problem. The item doesn't get selected.
The property is Selected
, not Select
:
_listView1.Items[i].Selected = true;
Just use ListViewItem.Selected
property;
_listView1.Items[i].Selected = true;
Gets or sets a value indicating whether the item is selected.