ListBox:: How to get datavalue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In web ASP.net List Box can get the DataValue on selected Item easily.

Is there any way I can get DataValue on a Winform ListBox Selected Item?

I don't want to use Ctype(selectedItem,
DataRowView).Item("ColumnName").toString, neither
SelectedItem("ColumnName").toString will work....

Because "ColumnName" may be different on each ListBox and it's not scalable.

strout
 
Use the SelectedValue property
(requires that ValueMember has been specified)

/claes
 
Back
Top