DataGrid / Data Binding / Custom Binding

Blazor DataGrid Example - Custom Data Binding

Loading Syncfusion Blazor Server Demos…

Drag a column header here to group its column
0 of 0 pages (0 items)

This sample demonstrates how to use custom data binding in the DataGrid component.

The Blazor DataGrid supports custom data binding by creating a custom adaptor class that extends the DataAdaptor abstract class. Override the Read or ReadAsync method to implement your custom data retrieval logic.

Register the custom adaptor class as a service in Startup.cs using the AddScoped or AddSingleton method. You can inject custom services or database contexts into your adaptor class using the Inject attribute.

Implement CRUD operations by overriding the following DataAdaptor methods:

  • Insert/InsertAsync - Handles record insertion.
  • Remove/RemoveAsync - Handles record deletion.
  • Update/UpdateAsync - Handles record updates.
  • BatchUpdate/BatchUpdateAsync - Handles batch update operations.

In this demo, CRUD operations are implemented using the DataAdaptor methods, and batch updates can be performed similarly using the BatchUpdate/BatchUpdateAsync methods.

For more detailed information about custom data binding, refer to the custom binding documentation.

Transform your Blazor web apps today with Syncfusion® Blazor components
145+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE