Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Add COM Objects as ComboBox items

$
0
0

Hi there!

I need help regarding something I thought would work but doesn't seems so: I am working with objects that are provided via a COM extension (to be specific from the Novell GroupWise Object API, if anyone wants to have a look). I can work quite nicely with the Objects and their properties. What I don't get is how to use and Address objects as Items for the CoboBox.

/* type definition: https://www.novell.com/documentation/developer/groupwise_sdk/gwsdk_gwobjapi/data/hq16f8tm.html */
GroupwareTypeLibrary.Application gw = new GroupwareTypeLibrary.Application();
/* type definition: https://www.novell.com/documentation/developer/groupwise_sdk/gwsdk_gwobjapi/data/hbkjddyi.html */
GroupwareTypeLibrary.Addresses proxies = gw.ProxyHistory;

foreach(GroupwareTypeLibrary.Address a in proxies)
{
    /* type definition: https://www.novell.com/documentation/developer/groupwise_sdk/gwsdk_gwobjapi/data/hg33vr0y.html */
    this.comboBox1.Items.Add(a);
}
this.comboBox1.ValueMember = "DisplayName";
this.comboBox1.DisplayMember = "DisplayName";

When Iadd the Address objects to the ComboBox it seems that the properties are not accessible and I get this view:

The properties for the objects are accessible when I use them in my code:

Any ideas?


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>