Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote
If someone can update the styling for the code, that'd be great. This editor is terrible. *This was meant to be a Bug Report, but it's showing as a Feature Request*


I have tried the code here (normally inside a non-Syncfusion modal) outside of a modal with no luck. I have tried the workaround here,
 in that last post, but that does not work either. I need to be able to set the value of the multiselect when clicking a button and opening a modal. I have tried both lists and arrays for the value type as well. Additionally, when setting the value this way, I cannot change the value through the UI as that will throw an error when trying to submit the form.

IList<Role> AvailableRolesList { get; set; } = new List<Role>();
IList<int> CurrentUserRolesList { get; set; } = new List<int>();


protected override async Task OnInitializedAsync() {
    AvailableRolesList = await _Roles.GetRoles(false);
}

<SfMultiSelect TValue="IList<int>" TItem="Role" @bind-Value="CurrentUserRolesList" DataSource="@AvailableRolesList" Mode="VisualMode.Checkbox">
    <MultiSelectFieldSettings Text="RoleName" Value="ID"></MultiSelectFieldSettings>
</SfMultiSelect>

foreach (UserRole role in user.Roles) {
CurrentUserRolesList.Add(role.ID);
}

When submitting the form, the following piece of code throws an error for "Object reference not set to an instance of an object", in reference to CurrentUserRolesList in the foreach definition.


foreach (int role in CurrentUserRolesList) {
    ....
}