Reputation: 167
I am creating a dropdown and I need to define an enum with inegerlike this
Public enum Example
{
[Description("Any")]
0,
[Description("1")]
1,
[Description("2")]
2
}
I want to display integers and values also as integers.
It gives syntax or compilation errors. Please help
Upvotes: 0
Views: 98
Reputation: 12837
public enum Example
{
[Description("Any")]
Any = 0,
[Description("1")]
One = 1,
[Description("2")]
Two = 2
}
Upvotes: 2