Expandoobject Data Binding With Edittemplate In Blazor Datagrid

Updated on Jun 01, 2025
blazor blazordatagrid crud datagrid dynamicbinding editing edittemplate expandoobject grid runtime-data sftextbox syncfusion textbox valuechange

This sample demonstrates how to bind the Syncfusion Blazor DataGrid to an ExpandoObject and use the EditTemplate feature to dynamically render a custom editor such as SfTextBox.

Overview

In this example:

  • The Grid is bound to a dynamic list of ExpandoObject items (Orders).

  • The CustomerID column uses an EditTemplate to render a SfTextBox during edit operations.

  • Changes made to the textbox are tracked using the ValueChange event and updated during the RowUpdating event.

  • ExpandoObject allows flexible, dynamic property management without predefined model classes.

Getting Started

Prerequisites

Project Setup

  1. Clone the repository:

     git clone https://github.com/SyncfusionExamples/ExpandoObject-data-binding-with-EditTemplate-in-Blazor-DataGrid.git
    
  2. Navigate to the project folder:

     cd ExpandoObject-data-binding-with-EditTemplate-in-Blazor-DataGrid
    
  3. Restore the NuGet packages:

     dotnet restore
    
  4. Build and run the application:

     dotnet run
    
  5. Open the browser at https://localhost:port (port varies).