Hi i cant seam to find what the issue is regarding this grid and the inline editing any help
.razor
<RadzenDataGrid @ref="_sfcForReworkGrid"
EditMode="DataGridEditMode.Single"
Data="@SfcForReworkVms"
TItem="SfcForReworkVm"
AllowColumnResize="true"
PageSize="10"
AllowPaging="true"
AllowSorting="true">
<Columns>
<RadzenDataGridColumn TItem="SfcForReworkVm" Property="Name" Title="@LanguageTable["Name"]">
<Template Context="selectedSfcForRework" >
<RadzenButton Text="@selectedSfcForRework.Name" ButtonStyle="ButtonStyle.Light" class="my-1 ms-1" Click="@((args) => ShowDetailedSfcModal(selectedSfcForRework))"></RadzenButton>
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="SfcForReworkVm" Property="Priority" Title="@LanguageTable["Description"]">
<EditTemplate Context="selectedSfcForRework">
<RadzenNumeric @bind-Value="selectedSfcForRework" Placeholder="@LanguageTable["Description"]" Style="width:100%;" Name="Name" />
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="SfcForReworkVm" Property="DeliveryDate" Title="@LanguageTable["Date"]">
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="AllowedJobOperationVm" Property="Name" Title="@LanguageTable["Name"]">
<EditTemplate Context="selectedSfcForRework">
<RadzenDropDown @bind-Value="selectedReworkState" Data="@AllowedJobOperationVms" TextProperty="AllowedJobOperationVms.OperationText" ValueProperty="Name" AllowClear=true Placeholder="@LanguageTable[""]" Style="width:100%;" />
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="SfcForReworkVm" Context="selectedSfcForRework" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Width="100px">
<Template Context="selectedSfcForRework">
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Size="ButtonSize.Small" class="my-1 ms-1" Click="@(args => EditRow(selectedSfcForRework))" />
</Template>
<EditTemplate Context="selectedSfcForRework">
<RadzenButton Icon="check" ButtonStyle="ButtonStyle.Success" Size="ButtonSize.Small" class="my-1 ms-1" Click="@((args) => SaveRow(selectedSfcForRework))" />
<RadzenButton Icon="close" ButtonStyle="ButtonStyle.Light" Size="ButtonSize.Small" class="my-1 ms-1" Click="@((args) => CancelEdit(selectedSfcForRework))" />
</EditTemplate>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
.cs
[CascadingParameter]
public IModalService Modal { get; set; } = default!;
[Inject]
public required IMediator Mediator { get; set; }
[Inject]
public required IToastService ToastService { get; set; }
[Inject]
public required IsTaskRunningService IsTaskRunningService { get; set; }
[Inject]
public required ILogger<OperationConfiguration> Logger { get; set; }
[Inject]
public required IUiNotificationService UiNotificationService { get; set; }
[Inject]
public required Toolbelt.Blazor.I18nText.I18nText I18nText { get; set; }
public I18nText.LanguageTable LanguageTable = new();
private RadzenDataGrid<SfcForReworkVm>? _sfcForReworkGrid;
public List<SfcForReworkVm> SfcForReworkVms { get; set; }
public List<AllowedJobOperationVm> AllowedJobOperationVms { get; set; } = new();
private Guid selectedReworkState;
protected override async Task OnInitializedAsync()
{
LanguageTable = await I18nText.GetTextTableAsync<I18nText.LanguageTable>(this);
SfcForReworkVms = (List<SfcForReworkVm>)await Mediator.Send(new GetFailedSfcsQuery());
UiNotificationService.ActiveTighteningUpdated += RefreshReworkStationAsync;
}
private async Task EditRow(SfcForReworkVm selectedSfcForRework)
{
//GetAllowedJobOperationsForSfcQuery query = new() { SfcId = selectedSfcForRework.Id };
//AllowedJobOperationVms = (List<AllowedJobOperationVm>)await Mediator.Send(query);
}
private async Task SaveRow(SfcForReworkVm selectedSfcForRework)
{
SendSfcBackToInProcessCommand command = new()
{
SfcId = selectedSfcForRework.Id,
TargetStandardJobOperationId = selectedReworkState
};
await Mediator.Send(command);
}
private void CancelEdit(SfcForReworkVm selectedSfcForRework)
{
}
private async Task ShowDetailedSfcModal(SfcForReworkVm selectedSfcForRework)
{
var parameters = new ModalParameters().Add(nameof(DetailedSfcModal.Message), $"");
var options = new ModalOptions() { UseCustomLayout = true };
var messageForm = Modal.Show<DetailedSfcModal>("Sfc Info", parameters, options);
}
public async void RefreshReworkStationAsync(object? sender, EventArgs e)
{
//if (SfcId == e.SfcId)
//{
await InvokeAsync(StateHasChanged);
//}
}
public void Dispose()
{
UiNotificationService.ActiveTighteningUpdated -= RefreshReworkStationAsync;
}
and also is it possibel to use 2 diffrent items i the same grid:
<RadzenDataGridColumn TItem="SfcForReworkVm" Property="DeliveryDate" Title="@LanguageTable["Date"]">
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="AllowedJobOperationVm" Property="Name" Title="@LanguageTable["Name"]">
<EditTemplate Context="selectedSfcForRework">
<RadzenDropDown @bind-Value="selectedReworkState" Data="@AllowedJobOperationVms" TextProperty="AllowedJobOperationVms.OperationText" ValueProperty="Name" AllowClear=true Placeholder="@LanguageTable[""]" Style="width:100%;" />
</EditTemplate>
</RadzenDataGridColumn>
