One Role Per User

Hi, I think this is a pretty simple one, I want to restrict users to one role only. So I turned off Multiple in the roles dropdown in the Add Application User form. However when I select just one role, it does not show up as selected. I'm assuming this is because the identity model allows for multiple roles. So my question is how do I restrict my users to just one role in the Add/Edit Application User forms?

You can do the following:

Add User

  1. Disable multiple selection for roles DropDown
  2. Remove the expression for roles DropDown Value property
  3. Set page property to selected item in DropDown Change
  4. Set user.RoleNames before create in Form Submit event

Edit User

  1. Set page properly RoleName when you get the user in page load:
  2. Disable multiple selection for roles DropDown
  3. Remove the expression for roles DropDown Value property and bind it to RoleName page property
  4. Set user.RoleNames before create in Form Submit event

In this way you will get single role selection:

Thanks worked perfectly!