Basically, I want to define an enumeration with decimal values, but that is not possible. An alternative is:
public static class EstadoRestriccion { public const decimal Valur1 = 0; public const decimal Value2 = 0.5M; public const decimal Value3 = 1; };
But I need to add these constants to the combobox, where the parameters for display should be the name of the constants, and SelectedItem should return the value (0, 0.5M, 1) or some of them. I know this is possible, but it is ugly.
With an enumeration, I can do this easily: comboBox.DataSource = Enum.GetValues(typeof(MyEnum));
What is the best way to model an enumeration with my requirements?
source share