The ID property is required to use the EnablePersistence
property in the Syncfusion Blazor MultiSelect component. The ID property is
used to uniquely identify the component on the page, which allows the component
to persist its selected items and other settings across page refreshes or
navigation.
Without setting the ID property, the EnablePersistence
feature will not work and the component will not be able to persist its
selected items and other settings.
<div>
<SfMultiSelect ID="multiSelect" @ref="@GamesRef" TItem="Games" Placeholder="Favorite
Sports" EnabledChangeOnBlur="false" DataSource="@LocalData" @bind-Value="@GamesBindValue" EnablePersistence="true" TValue="string[]" PopupHeight="500px" PopoutWidth="200px" Width="200px" AllowFiltering="false" Mode="VisualMode.CheckBox">
<MultiSelectFieldSettings Text="Text" Value="ID"></MultiSelectFieldSettings>
<MultiSelectEvents TItem="Games" TValue="string[]" ValueChange="@ValueChangeHandler" OnValueSelect="@OnValueSelect" OnValueRemove="@OnValueRemoveHandler" Cleared="@ClearedHandler" Blur="BlurHandler"></MultiSelectEvents>
</SfMultiSelect>
</div>
|
|
It is important to note that the ID should be unique for each
MultiSelect component on the same page, otherwise the persistence feature will
not work correctly.