B
bean
Hi,
I'm having problems binding an array of objects to a listbox. The
objects are from a webservices class running on our web server.
The array is coming from the website fine, and the data is binding ok
to the listbox, but when I run the program, the listbox just comes up
with the name of the object rather than the DisplayMember property I
have
set. All other operations getting data out of the array are working as
expected.
Does anyone have a clue what I'm doing wrong?
TIA,
Ian
Code:
shop.WSCategories wscategories = new shop.WSCategories();
shop.Category[] cats = wscategories.GetCategories();
lbCats.DisplayMember = "Name";
lbCats.ValueMember = "Id";
lbCats.DataSource = cats;
I'm having problems binding an array of objects to a listbox. The
objects are from a webservices class running on our web server.
The array is coming from the website fine, and the data is binding ok
to the listbox, but when I run the program, the listbox just comes up
with the name of the object rather than the DisplayMember property I
have
set. All other operations getting data out of the array are working as
expected.
Does anyone have a clue what I'm doing wrong?
TIA,
Ian
Code:
shop.WSCategories wscategories = new shop.WSCategories();
shop.Category[] cats = wscategories.GetCategories();
lbCats.DisplayMember = "Name";
lbCats.ValueMember = "Id";
lbCats.DataSource = cats;