c# - How to get the index of a listview item by it's text -
c# - How to get the index of a listview item by it's text -
i'm trying index of item it's text in listview. example, have list view contains items: "item1", "item2"..etc i've tried index of "item2" this:
messagebox.show(listview1.items.indexof("item2");
but it's not working... help please?
listview.finditemwithtext
method want. check out: msdn
var item = listview1.finditemwithtext("item2"); if (item != null) { messagebox.show(listview1.items.indexof(item).tostring()); }
c# forms listview
Comments
Post a Comment