ListBox:: How to get datavalue

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
 
C

Claes Bergefall

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

/claes
 

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