471,570 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

DataSource and Interfaces

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.
Dec 12 '05 #1
2 1664
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

John Richardson wrote:
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.

Dec 13 '05 #2
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.

"Franky" <dr***@bestopia.be> wrote in message
news:11***************@seven.kulnet.kuleuven.ac.be ...
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

John Richardson wrote:
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.

Dec 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by baylor | last post: by
1 post views Thread by praveen benna via DotNetMonster.com | last post: by
30 posts views Thread by Frank Rizzo | last post: by
8 posts views Thread by John | last post: by
9 posts views Thread by Sean Kirkpatrick | last post: by
22 posts views Thread by RSH | last post: by
23 posts views Thread by A.Gallus | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.