G
greg
Alright, googled this and found a ton of articles but none seem to help me.
Trying to set the selected item in a ListView. I'll just throw out some
pseudo-code here and it's basically not working. What am I missing?
foreach item in listview.items
if (some condition)
item.selected = true; // i've set a breakpoint here, it's called.
textBox1.text = listView1.selecteditems[0].text
Argument out of range happens. selectedItems is empty. Yet while I'm
debugging, in the Immiediate window I can evaluate
?listView1.items[0].selected
true
?listView1.SelectedItems
.... Count : 0 ...
From google I've tried executing listView1.Select() but that does nothing.
Is there some event I should manually be calling to force it to update the
SelectedItems list?
Thanks,
Greg
Trying to set the selected item in a ListView. I'll just throw out some
pseudo-code here and it's basically not working. What am I missing?
foreach item in listview.items
if (some condition)
item.selected = true; // i've set a breakpoint here, it's called.
textBox1.text = listView1.selecteditems[0].text
Argument out of range happens. selectedItems is empty. Yet while I'm
debugging, in the Immiediate window I can evaluate
?listView1.items[0].selected
true
?listView1.SelectedItems
.... Count : 0 ...
From google I've tried executing listView1.Select() but that does nothing.
Is there some event I should manually be calling to force it to update the
SelectedItems list?
Thanks,
Greg