Click here to Skip to main content
15,908,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing problem in finding index of selected item in listview using "SelectedIndices" ??
Anyone... please help...
var index = listView1.SelectedIndices;

Can anyone tell... after above stmt how i can get index of selected item?
Posted
Updated 26-Oct-10 23:18pm
v2
Comments
Toli Cuturicu 27-Oct-10 9:29am    
No txtspk, please.

Pleasse ellaborate what is required

\
private void listView1_SelectedIndexChanged(object sender, System.EventArgs e)
{
  Console.WriteLine ("The index of the first selected item is: {0}",
  ((ListViewItem)listView1.SelectedItems[0]).Index) ;
}
 
Share this answer
 
v4
Comments
Ashutosh kumar Tripathi 27-Oct-10 5:36am    
thanx roopiksa.. but m writing a form application for CF . n m not getting this SelectedItem[n] property :(
Here[^] is all you need.
 
Share this answer
 
Comments
Ashutosh kumar Tripathi 27-Oct-10 5:34am    
hi dave.. thanx for ans.. i went thru msdn.. but didnt get nything .. :( .. as i m totally new to this.. :(
Please ellaborate your question
 
Share this answer
 
Comments
Ashutosh kumar Tripathi 27-Oct-10 6:26am    
thanx roopikas... i solved my prob....

thank u all for response....

Ur response helped me solving my prob :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900