Horje
c# binding add combobox with enum values Code Example
c# binding add combobox with enum values
public class DataItem
{
    public MyEnum Value { get; set; }
    public string Text { get; set; }
}

this.comboBox1.DataSource = Enum.GetValues(typeof(MyEnum)).Cast<MyEnum>()
                                .Select(x => new DataItem() { Value = x, Text = x.ToString() })
                                .ToList();
this.comboBox1.ValueMember = "Value";
this.comboBox1.DisplayMember = "Text";

this.comboBox1.DataBindings.Add(
    new Binding("SelectedValue", yourObjectToBind, "PropertyOfYourObject"));




Csharp

Related
OpenBots convert Int to String Code Example OpenBots convert Int to String Code Example
split a datatable based on number of rows Code Example split a datatable based on number of rows Code Example
sum the digits in c Code Example sum the digits in c Code Example
What is the difference between String and string in C#? Code Example What is the difference between String and string in C#? Code Example
what loops are entry controlled c# Code Example what loops are entry controlled c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11