Hiya
The SelectedItem.Text does not work when binding to a DataTable, also, =
the item that is being searched for may not be the selected item. If I =
was to use the selected properties, I would have to loop through all the =
items in the ListBox, selected each one individually then interrogate =
the SelectedValue property.
I have decided to use a different control as it seems that the ListBox =
will not cater for what I want to do without more effort than it's =
worth.
Thanks for your reply.
Kind Regards,
Steve.
[quoted text, click to view] "GVaught" <glvaughtRemoveThis@hotmail.com> wrote in message =
news:ufJSvXRZEHA.3512@TK2MSFTNGP12.phx.gbl...
nameofListBox.SelectedIndex
nameofListBox.SelectedItem.Text
nameofListBox.Selected.Value
--=20
G Vaught
[quoted text, click to view] "Steve" <stevea@centurion-ms_RemoveThis_.co.uk> wrote in message =
news:e0iECkqYEHA.3536@TK2MSFTNGP11.phx.gbl...
Hi all
I have a ListBox and I need to find the index of a particular item. =
I know you can find a particular item using: myList.FindString("String =
To Search For"), but the item I'm searching for is in the ValueMember =
property of the ListBox.
I am binding to a DataTable and setting the DataSource, =
DisplayMember and ValueMember, does anyone know how to get the index of =
the item based on the ValueMember?
Kind regards,