enum and combobox



does anybody know how to use all values of an enumeration in a combobox?

i have an enum type defined like
public enum EnumTest
{
	val1 = 1,
	val2 = 2,
	val4 = 4,
}

i would like to bind this to a combobox so that i can use 'val1' als the displaymember of the combobox and the int as the valuemember.

any ideas?

thanks,
Dries
.



Relevant Pages

  • Re: enum and combobox
    ... Use a loop to iterate over and assign to your combobox. ... > public enum EnumTest ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: 100K item data binding: Is asynchronous data binding possible?
    ... As I mentioned, no matter what, you MUST bind on the UI thread, and like Marc said, on other controls, virtualizing the list might be an option, but not in this case. ... I THINK the problem is that the "slow/choke" occurs DURING the actual BIND ... You aren't going to be able to bind to the ComboBox asynchronously. ... that doesn't mean you can't load the data on another thread. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ComboBox Item (Windows Forms)
    ... ComboBox Item separately from the Value, since Item is an Object, and ... your ComboBox to a list of strings, a list of objects, a dataset, etc. ... you bind it to a list of string, ... name/value pair class, and using that when adding items to a ComboBox. ...
    (microsoft.public.dotnet.general)
  • Re: 100K item data binding: Is asynchronous data binding possible?
    ... I THINK the problem is that the "slow/choke" occurs DURING the actual BIND ... You aren't going to be able to bind to the ComboBox asynchronously. ... that doesn't mean you can't load the data on another thread. ... Currently, I can databind the 115,000 objects to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Should be Simple
    ... What is the point to bind the combobox if you already populate it in a loop? ... > In VB, on form frmData, I have comboboxes with style property set to> vbComboDrop-DownList. ... I populate the list portion> of each combo with lookup values from other tables with code similar to> the ... I get the following error "Unable to bind to field or DataMember:> 'Client'". ...
    (microsoft.public.vb.database.ado)