You can add Description attribute
public enum ChartType : short
{
Pie = 1,
Doughnut = 2,
Column = 3,
[Description("Column Stacked")]
ColumnStacked = 4,
Area = 5,
[Description("Area Stacked")]
AreaStacked = 6,
[Description("Area Spline")]
AreaSpline = 7,
Bar = 8,
[Description("Bar Stacked")]
BarStacked = 9,
Line = 10,
Spline = 11
}
You can get Description by below helper
public static class EnumExt
{
public static string Description(this Enum en)
{
string result = en.ToString();
Type EnumType = en.GetType();
FieldInfo fi = EnumType.GetField(result);
var da = Attribute.GetCustomAttribute(fi, typeof(DescriptionAttribute)) as DescriptionAttribute;
return (da != null ? da.Description : result);
}
}
ChartType.BarStacked.Description()