Simon_B
February 27, 2023, 8:49pm
1
I have an object called Employee
with a Roles
property which is a List of type Role. Role has only one property: Name. I would like to select roles of an employee with a multiple select dropdown component. I got that working the following way:
<RadzenDataGridColumn TItem="Employee" Property="Employee.Roles" Title="Roles">
<EditTemplate Context="employee">
<RadzenDropDown @bind-Value="@employee.Roles" Data=@roles TextProperty="Name" Multiple=true AllowClear=true Placeholder="Roles"> </RadzenDropDown>
</EditTemplate>
</RadzenDataGridColumn>
Looks like this:
The problem is this part: Property="Employee.Roles"
I cant show the selected role names combined in the grid
Looks like this:
Anyone got a solution for this?
Thanks
korchev
February 28, 2023, 6:10am
2
Hi @Simon_B ,
Check my reply in this thread: Show Roles in users grid is always empty - #6 by korchev
You need to set the Template as well. Probably
<RadzenDataGridColumn TItem="Employee" Property="Employee.Roles" Title="Roles">
<EditTemplate Context="employee">
<RadzenDropDown @bind-Value="@employee.Roles" Data=@roles TextProperty="Name" Multiple=true AllowClear=true Placeholder="Roles"></RadzenDropDown>
</EditTemplate>
<Template Context="employee">
@string.Join(", ", employee.Roles.Select(r => r.Name))
</Template>
</RadzenDataGridColumn>
1 Like
Hi @korchev ,
thanks for your reply. I will check that out soon and let you know if that solved my problem
Hi @korchev ,
inally able to try it out. Works perfectly for me. Thank you very much