Data binding in ASP.NET Core Tree Grid Component
18 Nov 20181 minute to read
The TreeGrid uses DataManager, which supports both RESTful JSON data services binding and local JavaScript object array binding. The dataSource property can be assigned either with the instance of DataManager or JavaScript object array collection.
It supports two kinds of data binding method:
- Local data
- Remote data
Binding with ajax
You can use TreeGrid dataSource property to bind the data source to TreeGrid from external Fetch request. In the below code we have fetched the data source from the server with the help of Fetch request and provided that to dataSource property by using onSuccess event of the Fetch.
NOTE
- If you bind the dataSource from this way, then it acts like a local dataSource. So you cannot perform any server side crud actions.
You can refer to ourASP.NET Core Tree Gridfeature tour page for its groundbreaking feature representations. You can also explore our ASP.NET Core Tree Grid exampleASP.NET Core Tree Grid exampleto knows how to present and manipulate data.
- If you bind the dataSource from this way, then it acts like a local dataSource. So you cannot perform any server side crud actions.
Handling expandStateMapping
To denotes the expand status of parent row, define the expandStateMapping property of tree grid.
The expandStateMapping property maps the field name in data source, that denotes whether parent record is in expanded or collapsed state and this is useful to renders parent row in expanded or collapsed state based on this mapping property value in data source.
You can refer to our
ASP.NET Core Tree Gridfeature tour page for its groundbreaking feature representations. You can also explore our ASP.NET Core Tree Grid exampleASP.NET Core Tree Grid exampleto knows how to present and manipulate data.