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
Source=System.Windows.Forms
ParamName=index
I am using this to get selected items:Items_list.SelectedItems[0].SubItems[2].Text;
I have noticed that at the moment i change selection the selected items count is 0 so what to do?
suneye
0
Newbie Poster
Recommended Answers
Jump to PostYou 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[0] which doesn't exist yet since no one has been given the chance to select …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.