I thought one of those events pass the ListViewItem object as parameter just like TreeView returns TreeViewNode but I was mistaken.
You can use just "tbSearch.Text = lv.FocusedItem.SubItems.Text;" and it would do it.
You must simply "walk through the listview" till you get the index of selected row and then you can do whatever you want in that row LIKE THIS:
for (int i = 0; i < lv.Items.Count; i++)
// is i the index of the row I selected?
if (lv.Items[i].Selected == true)
//I show here the second field text (SubItems.Text) from the selected row(Items[i])
Thats upto the guy who marks it as answered, wether he goes for the first answer, or the better answer, or in fact the wrong answer.. its entirely his choice. In a way Lord Soth beat you too it too, but, its upto the guy who grants the point..
I'd agree with LizR on this. The selected indices will be smaller than the entire list. If a list has a few hundred items and the user has selected 3, the loop becomes considerably less expensive on the indices rather than the entire list.
Insted of going through all the items go through only the selected items
Dim col As ListView.SelectedListViewItemCollection = lviFolders.SelectedItems
Dim itm As ListViewItem
For Each itm In col
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...