Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
UltraComboEditor binding List of objects display ToString() text?
posted

Hello,

With the .NET ComboBox, I can bind a generic List of our objects (e.g. List<Customer>) as its datasource (not setting DisplayMember / ValueMember) and the text displayed for each object is its overriden ToString() method.

With the UltraComboEditor, I bind the same list of objects (still not setting DisplayMember / ValueMember), but the text that is displayed for each object is its class name.

Is there a built-in way I can get the UltraComboEditor to behave like the .NET ComboBox and display each object using its ToString() method?

If not, is there a way I can inherit from the UltraComboEditor and take advantage of an override to display each bound object using its ToString() method?

Thanks,
David McClelland

ToStringTest.zip
Parents
No Data
Reply
  • 95
    Verified Answer
    posted

    OK, so I dug through the UltraComboEditor's source code that we have, and it turns out that specifying the DisplayMember and ValueMember as:

    Infragistics.Win.BindableValueList.USE_LISTOBJECT_AS_VALUEMEMBER

    ... does the trick!  This is noted in the documentation for the UltraComboEditor's ValueMember property, but not in the documentation for the DisplayMember property.

    I'm so glad I found this - I do hope in the future this behavior can be made a property of the UltraComboEditor so that it's more visible to developers.

    - David McClelland

Children