Hi,
I try to create a custom RadzenDataGridColumn, where the EditorTemplate is prefilled with a RadzenTextField based on the column Property.
My inheteded Colum is very simple just wraps the Textbox with a FormField, see the code below.
@typeparam TItem
@inherits RadzenDataGridColumn<TItem>
@{
EditTemplate = rowData =>
@<RadzenFormField Text="@Title" Variant="Variant.Text">
<RadzenTextBox Value="@((string?)PropertyAccess.GetValue(rowData, Property))"
ValueChanged="@(value => rowData.SetValue(Property, value))" />
</RadzenFormField>;
}
When I use MyColumn, in edit mode, the validation CSS classes are not applied to the textbox (the gird uses FluentValidation with NotEmpty constraint). The validation works, as I see the validation message, and the column that was created on the standard way has the validation CSS classes, but that is inside MyColumn is not highligted.
The first 'Kulcs' column is created on the standard way, the second 'Kulcs' column uses MyColumn.
<RadzenDataGridColumn TItem="TCreateOrEditTranslation" Property="@nameof(CreateOrEditTranslation.Key)" Title="Kulcs">
<EditTemplate>
<RadzenFormField Text="Kulcs" Variant="Variant.Text">
<RadzenTextBox @bind-Value="@context.Key" />
</RadzenFormField>
</EditTemplate>
</RadzenDataGridColumn>
<MyColumn TItem="TCreateOrEditTranslation" Property="@nameof(CreateOrEditTranslation.Key)" Title="Kulcs" />
How should I create the data binding of the RadzenTextBox in MyColumn?
@bind-Value would be the best, but I do not have the Property and expression cannot be used. With Value + ValueChanged I cannot access the EditContext to call NotifyFieldChanged or NotifyValidationStateChanged.
