Quantcast
Viewing all articles
Browse latest Browse all 15151

Getting the selected item in a ListView control

I am trying to get the selected item in a ListView control, the multi select is set to FALSE.

Is the SelectedIndexChanged event the best place to respond to a change in selection?

How do I get the current selected index, assuming only one item is selected, dealing with multi select will come later :)

I tried CurrentSelection = ListView_DirectorList.SelectedItems(0).Index

but it keeps throwing exceptions :

System.ArgumentOutOfRangeException: 'InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index'



Rick

Viewing all articles
Browse latest Browse all 15151

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>