How can we retrive value of selected items from the list box??

ngambhava

Newcomer
Joined
May 8, 2006
Messages
1
We have used one listbox in windows form and we bind it with datasource from database.

Listbox allows multiple selected.

How can we retrive value of selected items from the list box??

we tried following thing
for(int i=0;i<lstEducation.SelectedItems.Count;i++)
MessageBox.Show(lstEducation.SelectedItems.ToString());

But it prints System.Data.DataRowView

We couldnt find the way

please help
 
Each item is a DataRowView object based on the underlying data source - you need to cast it to a DataRowView and then you can access it's properties directly.
 
Back
Top