[PR #1550] [MERGED] [DataGrid] Enhanced DataGridColumn EditMode control #2804

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

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/1550
Author: @robertmclaws
Created: 6/9/2024
Status: Merged
Merged: 6/10/2024
Merged by: @enchev

Base: masterHead: master


📝 Commits (2)

  • 0bc2534 Adding RadzenGridColumn.IsInEditMode property, updating render check in RadzenDataGrid, and updating associated demo.
  • 6b8d703 Removed unnecessary usings.

📊 Changes

3 files changed (+77 additions, -34 deletions)

View changed files

📝 Radzen.Blazor/RadzenDataGrid.razor (+1 -1)
📝 Radzen.Blazor/RadzenDataGridColumn.razor.cs (+7 -1)
📝 RadzenBlazorDemos/Pages/DataGridInCellEdit.razor (+69 -32)

📄 Description

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>

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/radzenhq/radzen-blazor/pull/1550 **Author:** [@robertmclaws](https://github.com/robertmclaws) **Created:** 6/9/2024 **Status:** ✅ Merged **Merged:** 6/10/2024 **Merged by:** [@enchev](https://github.com/enchev) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`0bc2534`](https://github.com/radzenhq/radzen-blazor/commit/0bc25348384aacdb91bf5ba114c98ed7ceb5aea1) Adding RadzenGridColumn.IsInEditMode property, updating render check in RadzenDataGrid, and updating associated demo. - [`6b8d703`](https://github.com/radzenhq/radzen-blazor/commit/6b8d703a3d123fcd47dc8e589274d633971f903f) Removed unnecessary usings. ### 📊 Changes **3 files changed** (+77 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `Radzen.Blazor/RadzenDataGrid.razor` (+1 -1) 📝 `Radzen.Blazor/RadzenDataGridColumn.razor.cs` (+7 -1) 📝 `RadzenBlazorDemos/Pages/DataGridInCellEdit.razor` (+69 -32) </details> ### 📄 Description 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> ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2804