DataSource and Interfaces

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Richardson

    #1

    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.Displ ay" for the DisplayMember - doesn't work.
    How does DisplayMember work through reflection to retrieve the display
    values?

    Thanks.


  • Franky

    #2
    Re: DataSource and Interfaces

    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.columnn ame

    gtz,
    Dries

    John Richardson wrote:[color=blue]
    > 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.Displ ay" for the DisplayMember - doesn't work.
    > How does DisplayMember work through reflection to retrieve the display
    > values?
    >
    > Thanks.
    >
    >[/color]

    Comment

    • John Richardson

      #3
      Re: DataSource and Interfaces

      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" <dries@bestopia .be> wrote in message
      news:1134511943 .508898@seven.k ulnet.kuleuven. ac.be...[color=blue]
      > 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.columnn ame
      >
      > gtz,
      > Dries
      >
      > John Richardson wrote:[color=green]
      >> 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.Displ ay" for the DisplayMember - doesn't work.
      >> How does DisplayMember work through reflection to retrieve the display
      >> values?
      >>
      >> Thanks.[/color][/color]


      Comment

      Working...