Hi
Recently we were building a feature that allows the optional selection of multiple items, and decided to use the Telerik Multiselect component. A subcomponent of the feature reads from a file, and pre-selects items in the multiselect based on data in the file similarly to this sample:
foreach(string item in file)
{
selectedItemsList.Add(item);
}
At the moment, however, it seems that the Telerik Multiselect does not refresh its state when selected items are added and removed programatically, only when they are added or removed via user interaction. Would it be possible to have the Telerik Multiselect support the usage of ObservableCollection?
Thanks in advance!
Michael
Hello,
You can programmatically preselect items for our Multiselect as you can see from the example here: https://docs.telerik.com/blazor-ui/components/multiselect/overview#examples. The condition for that to be true is that the items you want to pre-select must be in the data source bound to the Data parameter. If they are not, you should add them and after that - select them. As with any other parameter that is not a value type, you must provide a new reference for the framework to update the component.
Regards,
Svetoslav Dimitrov
Progress Telerik