how to select a hilighted row from the listview.

S

shahla.saeed

hi,
plz help me out how to select a hilighted row from the listview.
listView1.Items.Selected=true. does not solve my prblem bcoz "i"
is unkown to me. what i need is that user can select any row frm the
listview and from that selected row i want to retrive its first two
coloums.(both coloums have the data of string type)......
plzzz help meee, programaticalyy how can i do this...i hope i hv
explain the scenerio properly.
 
J

Jeff Gaines

On 11/04/2007 in message
<[email protected]>
hi,
plz help me out how to select a hilighted row from the listview.
listView1.Items.Selected=true. does not solve my prblem bcoz "i"
is unkown to me. what i need is that user can select any row frm the
listview and from that selected row i want to retrive its first two
coloums.(both coloums have the data of string type)......
plzzz help meee, programaticalyy how can i do this...i hope i hv
explain the scenerio properly.


If it is not multi select trap the Selected Index Change event, check that
1 item is selected and SelectedItems[0] will be the one you want.
If it is a multi select List View then you need to iterate through all
SelectedItems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top