DataSource and Interfaces

J

John Richardson

This is probably a yes/no answer...

I have a datasource for a combobox, and my datasource is an IList. This
list may be composed of two class types, but all implement an INavItem
interface consisting of an ID, and Display field.

Can I specify an interface for the Display/ValueMember fields? I can't seem
to add "INavItem.Display" for the DisplayMember - doesn't work.
How does DisplayMember work through reflection to retrieve the display
values?

Thanks.
 
F

Franky

have you tried to just set "Display" as the DisplayMember. when you
should use a datatable you have to use the columnname as displaymember
and not datarow.columnname

gtz,
Dries
 
J

John Richardson

it's an IList of type ArrayList, and I have two types of custom classes. I
think the answer is no on this one. :)

It doesn't matter... I ditched the DataSource binding technique anyways due
to serious gimpiness on the part of the combobox control (ie: the .Text
property not matching the display when the Display is not an item in the
list!!!), and opted for a manual insertion of items to the .Items
collection. It seems that every time I try to save time with databinding, I
get burned. It's really not much of a time saver when you factor in
debugging.
 

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