hello, i am using the item selection changed property inorder to control the items in listview,when the user selects first any item every thing goes well but when he changes selection it gives this exception :
System.ArgumentOutOfRangeException was unhandled
Message=InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index
I am using this to get selected items:Items_list.SelectedItems.SubItems.Text;
I have noticed that at the moment i change selection the selected items count is 0 so what to do?
Jump to Post
You might be running into the problem during postback when the page is creating the listview again during the page load. Then once the event handler is called for the seletion change, you are requesting index which doesn't exist yet since no one has been given the chance to select …
All 2 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.