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
ExpandoObjectitems (Orders).The CustomerID column uses an
EditTemplateto render aSfTextBoxduring edit operations.Changes made to the textbox are tracked using the
ValueChangeevent and updated during theRowUpdatingevent.ExpandoObjectallows 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.gitNavigate to the project folder:
cd ExpandoObject-data-binding-with-EditTemplate-in-Blazor-DataGridRestore the NuGet packages:
dotnet restoreBuild and run the application:
dotnet run- Open the browser at https://localhost:port (port varies).