This sample demonstrates how to perform editing operations in the Syncfusion Blazor DataGrid (SfGrid) using custom command buttons. The Grid is configured with built-in CRUD support through GridEditSettings, while row-level editing actions are exposed through a dedicated command column. Users can edit, delete, save, and cancel changes directly from the Grid by clicking command buttons without relying on double-click editing.
- Uses the Syncfusion Blazor
SfGridcomponent with a strongly typed data source. - Binds data using the
DataSourceproperty (Orderscollection). - Configures editing using
GridEditSettings:AllowAdding="true"AllowEditing="true"AllowDeleting="true"AllowEditOnDblClick="false"
- Uses a custom command column implemented with
GridCommandColumns. - Provides row-level CRUD actions through:
CommandButtonType.EditCommandButtonType.DeleteCommandButtonType.SaveCommandButtonType.Cancel
- Visual Studio 2022 or later oror Visual Studio Code
Visual Studio 2022
- Clone or download this repository to your local machine.
- Open
CustomCommandEditing.slnin Visual Studio 2022. - Restore NuGet packages if they are not restored automatically.
- Build the solution.
- Run the project using F5 or Ctrl+F5.
- Navigate to the page containing the DataGrid sample.
- Use the command buttons in the Manage Records column:
- Click Edit to modify a row.
- Click Delete to remove a row.
- Click Save to commit changes.
- Click Cancel to discard changes.
Visual Studio Code
- Open the repository folder in Visual Studio Code.
- Open the integrated terminal.
- Navigate to the project directory.
dotnet restore
dotnet runPages/Index.razor— contains theSfGridimplementation, column definitions, command button configuration, sample data generation, and theOrdermodel.
- For general product questions, visit the Syncfusion Community Forum or Syncfusion Support.
- To report an issue specific to this sample, open a GitHub issue in this repository.
- Full documentation on Blazor DataGrid globalization and localization: https://help.syncfusion.com/grid-sdk/blazor/data-grid/global-local
This is a Syncfusion sample project provided to demonstrate product usage. Review the Syncfusion license terms before using Syncfusion components in your own applications.