I have a dropdown configured like this:
<RadzenDropDown Data="roles"
TValue="List<Role>"
@bind-Value="user.Roles"
TextProperty="Description"
Multiple="true"
AllowClear="true"
AllowSelectAll="false"/>
The user and role class:
public class User
{
public int UserId {get; set;}
public List<Role> Roles {get; set;}
}
public class Role
{
public int RoleId {get; set;}
public string Description {get; set;}
}
The Data and bind-Value properties are both initialized after making a call to the backend API.
The problem is that when the dropdown is created, if the user object already has a list containing roles, the dropdown will show the amount of roles selected, but the checkboxes will not be checked.
Can the dropdown pre-check based off of a list of objects?
In the screenshot above, the user.Roles list has 2 items: Administrator and Carousel Manager. How can I make the items be checked in the list by default?