Example of Custom Binding in Blazor DataGrid Component

DataGrid / Data Binding / Custom Binding

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

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

The Blazor DataGrid custom data binding can be performed by providing the custom adaptor class and overriding the DataAdaptor abstract class's Read or ReadAsync method

The custom adaptor class must be added as service using AddScoped/AddSingleton method in the Startup.cs. Using the Inject attribute on a specific property, you can inject your own services or DB context into a custom adaptor class.

The CRUD operations for the custom data binding in the DataGrid component can be implemented by overriding the DataAdaptor abstract class's CRUD methods, which are listed below.

  • Insert/InsertAsync - Performs Insert operation.
  • Remove/RemoveAsync - Performs Remove operation.
  • Update/UpdateAsync - Performs Update operation.
  • BatchUpdate/BatchUpdateAsync - Performs BatchUpdate operation.

In this demo, CRUD operations for the custom data binding are performed using the DataAdaptor abstract class's methods. Similarly, you can use the BatchUpdate/BatchUpdateAsync methods to perform Batch Update operations.

More information about the Custom data binding feature can be found in this documentation section.

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