How to get selected items or selected value list from RadzenDropDown when Multiple="true"
Cannot get selected item from OnChange when Multiple="true". But it works when multiple="true" is not used.
How to get selected items or selected value list from RadzenDropDown when Multiple="true"
Cannot get selected item from OnChange when Multiple="true". But it works when multiple="true" is not used.
@enchev yes I checked the example. But there is no mentioned how to get the multiple selected values in the example.
Thank you for your fast replies. I'm a beginner for Blazor
Can you tell me how to get selected values ββin @values ββand insert them into a list in @Code section?
Bumping this because it was never answered. The OP is asking about the Change event so I'm not sure why you responded with a two-way binding example. He's correct that there is no example in the docs for multi-select.
A year late but in case anyone else discovers this, here's how I did it.
public void UpdateSplits(object args)
{
try
{
var iterator = args as IEnumerable;
var list = iterator.ToList();
SelectedSplits = Splits.Where(split => list.Contains(split.OptionName)).ToList();
StateHasChanged();
}
catch (Exception ex)
{
}
}
For multi-select, args is an iterator containing the string values of the select. So I needed to match them back to my original dataset to get the selected value.