Expandoobject Data Binding With Edittemplate In Blazor Datagrid

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 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.
Getting Started
Prerequisites
- .NET 6.0 SDK or later
- Visual Studio 2022 or any IDE that supports Blazor
- Syncfusion Blazor NuGet packages
Project Setup
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).
