Listview

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

hi everyone,

How can i select one item or subitem from a listview en put it in a
textbox?

Thx
 
You can use the SelectedItems property. The following example will use the
first selected item from the listview (index 0):
TextBox1.Text = ListView1.SelectedItems(0).Text
TextBox1.Text = ListView1.SelectedItems(0).SubItems(0).Text


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
Jan said:
hi everyone,

How can i select one item or subitem from a listview en put it in
a textbox?

You can select items but not individual subitems. The selected items are
returned by the Listview's SelectedItems property. Each ListviewItem has a
SubItems property that returns the subitems.
 
You can use the SelectedItems property. The following example will use the
first selected item from the listview (index 0):
TextBox1.Text = ListView1.SelectedItems(0).Text
TextBox1.Text = ListView1.SelectedItems(0).SubItems(0).Text

thx, this worked fine for me
you put me in the right direction
 
* Jan said:
How can i select one item or subitem from a listview en put it in a
textbox?

Set the 'ListViewItem''s 'Selected' property to 'True' and get its
'Text' property value.
 
Back
Top