Hi!
I have the following code:
<RadzenDataGrid AllowFiltering="true"
FilterMode="FilterMode.Simple"
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
AllowPaging="false"
AllowSorting="true"
Data="@AppStateService.AppState.JobVms"
TItem="JobVm"
SelectionMode="DataGridSelectionMode.Single"
RowSelect=@((x) => SelectJob(x))
@bind-Value=@selectedJobVms
>
List<JobVm> selectedJobVms;
@code {
protected override void OnInitialized()
{
if(AppStateService.AppState.selectedJobId > 0)
{
var selectedJob = AppStateService.AppState.JobVms
.Where(x => x.JobId == AppStateService.AppState.selectedJobId)
.SingleOrDefault();
if(selectedJob != null)
{
selectedJobVms.Add(selectedJob);
}
}
AppStateService.OnChange += StateHasChanged;
}
...
}
This is causing me problems. It seems that you cannot use bind-Value while also using RowSelect.
It produces the following error:
"Error CS1503: Argument 2: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback<System.Collections.Generic.List<DbClassLibrary.CameraVm>>' to 'Microsoft.AspNetCore.Components.EventCallback"
My requirement is to show the selected JobVm when the component is loaded but to also allow a customer to choose a different job by clicking a different row. How may this be achieved, please?
Thanks in advance.