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
.
In this example:
-
The Grid is bound to a dynamic list of
ExpandoObject
items (Orders
). -
The CustomerID column uses an
EditTemplate
to render aSfTextBox
during edit operations. -
Changes made to the textbox are tracked using the
ValueChange
event and updated during theRowUpdating
event. -
ExpandoObject
allows flexible, dynamic property management without predefined model classes.
- .NET 6.0 SDK or later
- Visual Studio 2022 or any IDE that supports Blazor
- Syncfusion Blazor NuGet packages
-
Clone the repository:
git clone https://github.com/SyncfusionExamples/ExpandoObject-data-binding-with-EditTemplate-in-Blazor-DataGrid.git
-
Navigate to the project folder:
cd ExpandoObject-data-binding-with-EditTemplate-in-Blazor-DataGrid
-
Restore the NuGet packages:
dotnet restore
-
Build and run the application:
dotnet run
-
Open the browser at https://localhost:port (port varies).