bind dropdown to enum

  • Thread starter Thread starter John A Grandy
  • Start date Start date
comboBox1.DataSource = Enum.GetNames(typeof(MyEnum));

you can bind arraylists to a combox box, but can't use the ValueMemeber or
other related properties that you can when you bind a datatable

Vijay
 
It may be better to use .GetValues; the text should appear the same, but it
means that SelectedItem should return the enum rather than a string.

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Creating dropdown through enum 3
WinForms Binding to Enum Properties 1
about enum 3
Enum TypeConverter 3
Data binding with enums? 2
Combobox and Nullable Enum 1
Merge Info From Two Enums 1
enum type 3

Back
Top