I have a enum which contains 3 values for 3 checkboxes:
public enum Str
{
Test = 1,
Exam = 2,
Mark = 4
}
Imagine these are checkboxes. If I select any of them it works fine but when I select multiple checkboxes are selected, Enum values are getting added.
When I check Test and Mark Enum value is 5
and when I select Test and Exam the result is 3
I even tried Type casting
string sVal = "checkbox Value";
bool ival = int.TryParse(sValue,out iVal);
if(iVal)
{
int iValue = int.Parse(sValue)
str s = (str)iValue;
}
again "s" returns the added value not the enum types how to solve this?