Listbox datasource binding issue
We have one project in which we have issue in databinding after deleting the datasource.
Following is the code that is creating issue
lstBox.DataSource = Nothing
lstBox.DisplayMember = "DisplayMem"
lstBox.ValueMember = "ValueMem"
lstBox.DataSource = lstBindingSource
The issue in executing the above code present the listbox with the class name in the list box. e.g. MyNamespace.Person
I have changed code to following and it resolves the issue somehow
.
lstBox.DataSource = Nothing
lstBox.DataSource = lstBindingSource
lstBox.DisplayMember = "DisplayMem"
lstBox.ValueMember = "ValueMem"
listbox.DisplayMember=”Membertext”;
listbox.ValueMember=”ValueFied”;
listbox.datasource=ob.Display(); //returns collections
aman
May 27, 2009 at 1:22 pm