Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. system._ComObject databinding [modified]

system._ComObject databinding [modified]

Scheduled Pinned Locked Moved C#
helpwpfwcf
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    ddecoy
    wrote on last edited by
    #1

    I have a class that interops with a booking tool, the class only returns system._ComObjects I can do late binding cause I know what type is being returned.

    public BindingList<NameElement> GetPassengers()
    {
    BindingList<NameElement> names = new BindingList<NameElement>();
    ComClass _comClass = new ComClass();
    comClass.RetrieveCurrent();
    // comClass.IObj_NameElements contains 2 system._ComObject
    foreach (NameElement name in comClass.IObj_NameElements)
    // The cast to NameElement is successful
    {
    names.Add(name);// I fill up a list of 2 NameElement objects
    }
    return names;
    }

    The problem is that when I try to use this list to bind it to a control by setting it's datasource to this list, the displaymember and valuemember can't be set because I get the error : 'Cannot bind to the new display member. Parameter name: newDisplayMember' Calling properties from the NameElement objects is no problem:

    Console.WriteLine(names[0].LastName)

    I have no clue why the data binding doesn't work ... :doh: Any help is as appreciated.

    modified on Wednesday, January 27, 2010 8:40 AM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups