[PR #1550] [DataGrid] Enhanced DataGridColumn EditMode control #2806

Closed
opened 2026-01-29 18:20:33 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/radzenhq/radzen-blazor/pull/1550

State: closed
Merged: Yes


Creates a more elegant solution for #1543.

  • Adds an IsInEditMode Func on RadzenDataGridColumn that allows you to override when to show the EditTemplate, with a default Func that evaluates to false so the previous behavior can proceed as expected.
  • Enhances the proper codepath in RadzenDataGrid to evaluate whether the EditTemplate should be rendered.
  • Enhances the InCellEditMode demo with a structure that would be more in line with customer expectations, including:
    • comments on things to pay attention to when making changes
    • comments on where to make changes for your own custom behaviors
    • some minor variable name fixes
  • All unit tests pass

Simple example:

        <RadzenDataGridColumn TItem="Order" Property="ShipName" Title="Ship Name" IsInEditMode="@IsEditing">
            <Template Context="order">
                <RadzenText Text="@(order.ShipName)" />
            </Template>
            <EditTemplate Context="order">
                <RadzenTextBox @bind-Value="order.ShipName" Style="width:200px; display: block" Name="ShipName" aria-label="Enter ship name" />
                <RadzenRequiredValidator Text="ShipName is required" Component="ShipName" Popup="true" />
            </EditTemplate>
        </RadzenDataGridColumn>
**Original Pull Request:** https://github.com/radzenhq/radzen-blazor/pull/1550 **State:** closed **Merged:** Yes --- Creates a more elegant solution for #1543. - [x] Adds an `IsInEditMode` Func on `RadzenDataGridColumn` that allows you to override when to show the `EditTemplate`, with a default Func that evaluates to `false` so the previous behavior can proceed as expected. - [x] Enhances the proper codepath in `RadzenDataGrid` to evaluate whether the `EditTemplate` should be rendered. - [x] Enhances the `InCellEditMode` demo with a structure that would be more in line with customer expectations, including: - [x] comments on things to pay attention to when making changes - [x] comments on where to make changes for your own custom behaviors - [x] some minor variable name fixes - [x] All unit tests pass Simple example: ```razor <RadzenDataGridColumn TItem="Order" Property="ShipName" Title="Ship Name" IsInEditMode="@IsEditing"> <Template Context="order"> <RadzenText Text="@(order.ShipName)" /> </Template> <EditTemplate Context="order"> <RadzenTextBox @bind-Value="order.ShipName" Style="width:200px; display: block" Name="ShipName" aria-label="Enter ship name" /> <RadzenRequiredValidator Text="ShipName is required" Component="ShipName" Popup="true" /> </EditTemplate> </RadzenDataGridColumn> ```
claunia added the pull-request label 2026-01-29 18:20:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#2806