RadzenDropDown: how to load data with multiple selected items?

I have RadzenDropDown whose data comes from other components or DB and need to load pre-selected items, I could not find a way to do that. For example below, "allExpressions" comes from other control where few items are already pre-selected.

List allExp = "a","b","c","d" but "b" and "c" should be checked when loaded in.

<RadzenDropDown
AllowFiltering="true"
FilterOperator="StringFilterOperator.Contains"
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
Multiple="true"
Data="@allExpressions"
TValue="IEnumerable"
@bind-Value="expressionNameList"
TextProperty="Name"
ValueProperty="Name"
Change="@(args => OnChangeExpression(args))" />

Hi @ShishirDahal,

You can refer to the DropDown demo. The one which has multiple selection enabled shows how to select multiple values.

 <RadzenDropDown @bind-Value="multipleValues" 
     Multiple="true" 
     Data="@customers" 
     TextProperty="CompanyName" 
     ValueProperty="CustomerID"
/>
@code {
   IEnumerable<string> multipleValues = new string[] { "ALFKI", "ANATR" };
}
1 Like