Hi
I'm trying to setup a datagrid with inline editing. I used the methods shown in datagrid-inline-edit
It's working fine for the most of the fields. Only with the DateTime fields I experience a strange behaviour.
For the DateTime fields I use a RadzenDatePicker inside the EditTemplate;
@page "/EditRecordingRequest/{RequestId}"
@using ....Core.Models;
@inherits PageBase
<div width="90%">
<RadzenDataGrid Data="@Model.ScheduledTimeSlots"
TItem="ScheduledTimeSlot"
@ref="timeSlotsGrid"
RowUpdate="UpdateTimeSlot"
EditMode="DataGridEditMode.Single">
<Columns>
<RadzenDataGridColumn TItem="ScheduledTimeSlot" Property="@(nameof(ScheduledTimeSlot.End))" Title="End">
<Template Context="scheduledTimeSlot">
<div>
@scheduledTimeSlot.End
</div>
</Template>
<EditTemplate Context="scheduledTimeSlot">
<RadzenDatePicker @bind-Value=@scheduledTimeSlot.End
TValue="DateTime"
ShowTime="true"
ShowSeconds="false"
HoursStep="1"
MinutesStep="1"
DateFormat="dd/MM/yyyy HH:mm" />
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ScheduledTimeSlot" Title="Edit" Sortable="false">
<Template Context="scheduledTimeSlot">
<RadzenButton ButtonStyle="ButtonStyle.Info"
Text="Edit"
Size="ButtonSize.Small"
Click="@(args => EditTimeSlot(scheduledTimeSlot))"
@onclick:stopPropagation="true" />
</Template>
<EditTemplate Context="scheduledTimeSlot">
<RadzenButton ButtonStyle="ButtonStyle.Primary"
Text="Save"
Size="ButtonSize.Small"
Click="@(args => SaveEditedTimeSlot(scheduledTimeSlot))" />
<RadzenButton ButtonStyle="ButtonStyle.Secondary"
Text="Cancel"
Size="ButtonSize.Small"
Click="@(args => CancelEditTimeSlot(scheduledTimeSlot))" />
</EditTemplate>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
</div>
I believe this is pretty similar to the method used in the sample. (for readability I left out some parts)
But when I pick a different date/time in the RadzenDatePicker, the DataGridRow immediately returns to the viewing state, instead of staying in the editing state.
I cannot understand this behaviour. Because for all other fields (which are not included above) everything seems to work fine.
Any clues?
Thanx in advance.
Henk