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

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

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

State: closed
Merged: No


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

**Original Pull Request:** https://github.com/radzenhq/radzen-blazor/pull/1005 **State:** closed **Merged:** No --- 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
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#2462