Is there a way to bind a combobox to an enum, since there are no methods to get all the values of enums?
My enum is like this:
public enum SportName
{
[Display(Name = "football", Description = "Football")]
Football,
[Display(Name = "table-tennis", Description = "Table Tennis")]
TableTennis
}
I have a method that is retrieving the attributes. My problem is how to bind these values to a ComboBox and the combobox shoul display the Description for each item.
For me, finding a way to iterate through the enum and creating some kind of a list would be enough but I dont know how to do that.