It is necessary to display the index of the selected ListView.SelectIndex element for some unknown reason, it gives out indexes with a delay, that is, after the first click it returns -1 (as if nothing is selected) when overlapping to another element, it returns the value of the first. Ie gives the values of the previous item. How to get to give it up to date information?
1 answer
Try using the ItemClick event instead of the highlight event, and also enable Enabled in the ListView ItemClick settings. At the click event, use e.ClickedItem - this is the object that you selected. Next ListViev.Items.IndexOf (e.ClickedItem reduced to the type of object) - you get an index.
|