Closed hedymhj closed 6 years ago
SelectedItems is a collection of ListViewItem so just access the first index to get the first item from it
if (Materialskinlistview1.SelectedItems.Count == 1)
{
var tag = Materialskinlistview1.SelectedItems[0].Tag;
}
Thanks. But i want the index of user selected item. If you have 7 items , when user clicks on the 2nd item a label will show "choice #2". And so. I can't guess which one user will select.
SelectedItems is a collection of all selected items, so if the user selects one item it will only hold that one item, in the case of MultiSelect = true it can hold multiple selected items though.
One type of use could be to listen for SelectedIndexChanged event and handle the label changes there.
are you familiar with WinForms ListView? since that has the exact same behavior in fact it inherits from it.
Thank you Dutchs. 👍
Hi, is there a way to get user selected item Tag in MaterialSkin like listbox? Like listbox1.selectedvalue or listbox1.selecteditem.tag ?? i have a label to get item tag when user clicks on MaterialSkin listview i tried : Materialskinlistview1.selecteditems.item().tag . but there's a missing index for the user selected item. Thanks.