Mangment enumValue = (Mangment)Enum.Parse(typeof(Mangment), itemChecked.ToString(), true)
C# checkboxlist with enum
-
20-09-2022 - |
Вопрос
I have an enum:
enum Mangment{
ReportsManagment,
NormalUserManagment,
PowerUserManagment
};
Now, I want to create a checkboxlist and allow the user to chose from this 3 options, than i want to get the selection out back as an enum and process it.
This is my code:
private void saveB_Click(object sender, System.EventArgs e)
{
try
{
foreach (object itemChecked in rolesPermissionsCBL.CheckedItems)
{
var permissionsName = itemChecked.ToString();
## How do i get the item checked as an enum..?
}
}
}
Решение
Не связан с StackOverflow