I have an enum like this:
public enum ProductGroup
{
A = 1,
B = 2,
C = 4,
D = 8
}
How can I get ProductGroup enum values? For example, when my enum value is ProductGroup.C I want get its value 4;
Just cast it as an int to get the index value.
So:
ProductGroup productGroup = ProductGroup.C;
Int32 productGroupIndex = (Int32)productGroup;
In the above example, productGroupIndex == 4.