Hi how can I pre select the rows of the datagrid from a list of ids, I only want to match the IDs not the whole data
thanks
Regards
Hi how can I pre select the rows of the datagrid from a list of ids, I only want to match the IDs not the whole data
thanks
Regards
You can use @bind-Value to preselect DataGrid items. Check this demo for more info about multiple selection:
Good morning, thanks, yep I used this tutorial as exempla, but only works if I pass the whole data not only the ids, here is my code
List<User> users = new List<User>();
IList<User> selectedUsers;
protected override async Task OnInitializedAsync()
{
users = await UserService.GetAllAsync();
User _user = new()
{
ID = "A0000553110"
};
selectedUsers.Add(_user);
}
Yes, DataGrid Value works with data items, not only by id values. You can find needed items by id using Where().