User friendly display for combobox

  • Thread starter Thread starter jabailo
  • Start date Start date
J

jabailo

For a Windows Form combobox:

I want to store an object in the Items collection of a combobox, but I
want the combo box to display a single string field (property) of that
object.

Can that be done?
 
I want to store an object in the Items collection of a combobox, but I
want the combo box to display a single string field (property) of that
object.

Can that be done?

Yes. The ComboBox calls ToString() for every object in its Items
collection, and displays the result.
 
Jabailo,

As I understand you well than you mean that you want to set your class as
datasource and the property as displaymember, it that right?

Cor
 
Back
Top