[PR #1005] [CLOSED] Add "Create" Button Functionality to RadzenDropDownDataGrid Component #2460

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

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/1005
Author: @bikotoru
Created: 6/3/2023
Status: Closed

Base: masterHead: master


📝 Commits (2)

  • 6d33ea1 Update RadzenDropDownDataGrid.razor
  • 4629acb Update RadzenDropDownDataGrid.razor.cs

📊 Changes

2 files changed (+755 additions, -700 deletions)

View changed files

📝 Radzen.Blazor/RadzenDropDownDataGrid.razor (+8 -1)
📝 Radzen.Blazor/RadzenDropDownDataGrid.razor.cs (+747 -699)

📄 Description

I have added a new feature to the RadzenDropDownDataGrid component that allows the inclusion of a "Create" button. This button enables the invocation of an external function, which provides the capability to create a new record without navigating to a different page.

Changes Made:

  • Added a new parameter called OnCreate of type Action to the RadzenDropDownDataGrid component.
  • Included the "Create" button next to the existing "Search" button.
  • Linked the OnCreate function to the "Create" button's click event.

Usage Example:


@code {
    private async Task OnAdd()
    {
        await DialogService.OpenAsync<AddRegion>("Add Region", null);
    }
}
           <RadzenDropDownDataGrid Data="@regionsForregion" TextProperty="name" ValueProperty="id" AllowClear=true
                                            Disabled=@(hasregionValue) Placeholder="Seleccionar Comuna" style="display: block; width: 100%" @bind-Value="@comuna.region" Name="region"
                                            SearchText="Nombre Región"
                                            ShowCreate="true"
                                            RefreshAfterCreate="true"
                                        OnAdd="OnAdd">

With this enhancement, users can now create a new record by clicking the "Create" button directly within the dropdown grid component, offering a more convenient and efficient user experience.

Please review and merge these changes at your earliest convenience.

Thank you!

https://github.com/radzenhq/radzen-blazor/assets/6192404/81ba1edf-3d77-426d-8c90-50290c16fccc


🔄 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/1005 **Author:** [@bikotoru](https://github.com/bikotoru) **Created:** 6/3/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`6d33ea1`](https://github.com/radzenhq/radzen-blazor/commit/6d33ea1647b250be605347891b34f75f5d41429c) Update RadzenDropDownDataGrid.razor - [`4629acb`](https://github.com/radzenhq/radzen-blazor/commit/4629acb5cb4e730111b2545ec26fcc4064e10d70) Update RadzenDropDownDataGrid.razor.cs ### 📊 Changes **2 files changed** (+755 additions, -700 deletions) <details> <summary>View changed files</summary> 📝 `Radzen.Blazor/RadzenDropDownDataGrid.razor` (+8 -1) 📝 `Radzen.Blazor/RadzenDropDownDataGrid.razor.cs` (+747 -699) </details> ### 📄 Description I have added a new feature to the RadzenDropDownDataGrid component that allows the inclusion of a "Create" button. This button enables the invocation of an external function, which provides the capability to create a new record without navigating to a different page. Changes Made: - Added a new parameter called `OnCreate` of type `Action` to the RadzenDropDownDataGrid component. - Included the "Create" button next to the existing "Search" button. - Linked the `OnCreate` function to the "Create" button's click event. Usage Example: ``` @code { private async Task OnAdd() { await DialogService.OpenAsync<AddRegion>("Add Region", null); } } <RadzenDropDownDataGrid Data="@regionsForregion" TextProperty="name" ValueProperty="id" AllowClear=true Disabled=@(hasregionValue) Placeholder="Seleccionar Comuna" style="display: block; width: 100%" @bind-Value="@comuna.region" Name="region" SearchText="Nombre Región" ShowCreate="true" RefreshAfterCreate="true" OnAdd="OnAdd"> ``` With this enhancement, users can now create a new record by clicking the "Create" button directly within the dropdown grid component, offering a more convenient and efficient user experience. Please review and merge these changes at your earliest convenience. Thank you! https://github.com/radzenhq/radzen-blazor/assets/6192404/81ba1edf-3d77-426d-8c90-50290c16fccc --- <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:18:56 +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#2460