You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/treegrid/data-binding.md
+31-31Lines changed: 31 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,28 @@
1
1
---
2
2
layout: post
3
3
title: Data Binding in Blazor TreeGrid Component | Syncfusion
4
-
description: Checkout and learn here all about Data Binding in Syncfusion Blazor TreeGrid component and much more.
4
+
description: Learn how to bind data to Syncfusion Blazor TreeGrid using local lists, remote services, ObservableCollection and DynamicObject.
5
5
platform: Blazor
6
-
control: Tree Grid
6
+
control: TreeGrid
7
7
documentation: ug
8
8
---
9
9
10
10
# Data Binding in Blazor TreeGrid Component
11
11
12
-
The Tree Grid uses **SfDataManager**, which supports both RESTful Web Services binding and List binding. The [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property can be assigned either using the **SfDataManager** as child component of the Tree Grid Blazor component or list of business objects.
12
+
The TreeGrid uses **SfDataManager**, which supports both RESTful Web Services binding and List binding. The [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property can be assigned either using the **SfDataManager** as child component of the Tree +Grid Blazor component or list of business objects.
13
13
It supports two kinds of data binding method:
14
14
* List binding
15
15
* Remote service binding
16
16
17
-
To learn about how to bind local or remote data to Tree Grid, check out this video:
17
+
To learn about how to bind local or remote data to TreeGrid, check out this video:
{% youtube alt="Syncfusion Blazor TreeGrid Data Binding Tutorial" "https://www.youtube.com/watch?v=YgSRj7yTebI" %}
20
20
21
21
## List binding
22
22
23
-
In List binding, data source for rendering the Tree Grid component is retrieved from the same application locally.
23
+
In List binding, data source for rendering the TreeGrid component is retrieved from the same application locally.
24
24
25
-
Two types of Data binding are possible with the Tree Grid component.
25
+
Two types of Data binding are possible with the TreeGrid component.
26
26
27
27
* Self-Referential Data binding (Flat Data)
28
28
* Hierarchical Data binding
@@ -33,7 +33,7 @@ For Hierarchy Data binding, the data-source should be assigned as an object arra
33
33
34
34
### Self-Referential data binding/Flat Data
35
35
36
-
Tree Grid is rendered from Self-Referential data structures by providing two fields, [IdMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_IdMapping) field and [ParentIdMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_ParentIdMapping) field.
36
+
TreeGrid is rendered from Self-Referential data structures by providing two fields, [IdMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_IdMapping) field and [ParentIdMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_ParentIdMapping) field.
37
37
38
38
*[IdMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_IdMapping): This field contains unique values used to identify nodes.
39
39
*[ParentIdMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_ParentIdMapping): This field contains values that indicate parent nodes.
@@ -87,7 +87,7 @@ Tree Grid is rendered from Self-Referential data structures by providing two fie
87
87
88
88
The [ChildMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_ChildMapping) property is used to map the child records in hierarchy data source.
89
89
90
-
The following code example shows how to bind the hierarchical list data into the Tree Grid component.
90
+
The following code example shows how to bind the hierarchical list data into the TreeGrid component.
91
91
92
92
```cshtml
93
93
@@ -147,9 +147,9 @@ N> * ExpandCollapse State maintenance is not supported for Hierarchy Data.
147
147
148
148
### DynamicObject binding
149
149
150
-
Tree Grid is a generic component which is strongly bound to a model type. There are cases when the model type is unknown during compile type. In such cases the data can be bound to the tree grid as list of **DynamicObject**.
150
+
TreeGrid is a generic component which is strongly bound to a model type. There are cases when the model type is unknown during compile type. In such cases the data can be bound to the TreeGrid as list of **DynamicObject**.
151
151
152
-
**DynamicObject** can be bound to tree grid by assigning to the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property. Tree Grid can also perform all kind of supported data operations and editing in DynamicObject.
152
+
**DynamicObject** can be bound to TreeGrid by assigning to the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property. TreeGrid can also perform all kind of supported data operations and editing in DynamicObject.
153
153
154
154
N> The [GetDynamicMemberNames](https://learn.microsoft.com/en-us/dotnet/api/system.dynamic.dynamicobject.getdynamicmembernames?view=net-8.0) method of DynamicObject class must be overridden and return the property names to render and perform data operations, editing etc., while using DynamicObject.
155
155
@@ -251,9 +251,9 @@ N> The [GetDynamicMemberNames](https://learn.microsoft.com/en-us/dotnet/api/syst
251
251
252
252
### ExpandoObject binding
253
253
254
-
Tree Grid is a generic component which is strongly bound to a model type. There are cases when the model type is unknown during compile type. In such cases bind data to the tree grid as list of ExpandoObject.
254
+
TreeGrid is a generic component which is strongly bound to a model type. There are cases when the model type is unknown during compile type. In such cases bind data to the TreeGrid using a list of ExpandoObject.
255
255
256
-
ExpandoObject can be bound to Tree grid by assigning to the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property. Tree Grid can also perform all kind of supported data operations and editing in ExpandoObject.
256
+
ExpandoObject can be bound to TreeGrid by assigning to the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property. TreeGrid can also perform all kind of supported data operations and editing in ExpandoObject.
257
257
258
258
```cshtml
259
259
@@ -652,18 +652,18 @@ The following screenshot represents the TreeGrid with **Observable Collection**.
652
652
653
653
## Remote Service binding
654
654
655
-
To bind remote data to Tree Grid component, assign service data as an instance of **SfDataManager** to the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property. To interact with remote data source, provide the endpoint **url** and define the [HasChildMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_HasChildMapping) property of tree grid.
655
+
To bind remote data to TreeGrid component, assign service data as an instance of **SfDataManager** to the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_DataSource) property. To interact with remote data source, provide the endpoint **url** and define the [HasChildMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_HasChildMapping) property of TreeGrid.
656
656
657
657
The [HasChildMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_HasChildMapping) property maps the field name in data source, that denotes whether current record holds any child records. This is useful internally to show expand icon while binding child data on demand.
658
658
659
-
The Tree Grid provides **Load on Demand** support for rendering remote data. The Load on demand is considered in Tree Grid for the following actions.
659
+
The TreeGrid provides **Load on Demand** support for rendering remote data. The Load on demand is considered in TreeGrid for the following actions.
660
660
661
661
* Expanding root nodes.
662
-
* Navigating pages, with paging enabled in Tree Grid.
662
+
* Navigating pages, with paging enabled in TreeGrid.
663
663
664
664
When load on demand is enabled, all the root nodes are rendered in collapsed state at initial load.
665
665
666
-
When load on demand support is enabled in Tree Grid with paging, the current or active page’s root node alone will be rendered in collapsed state. On expanding the root node, the child nodes will be loaded from the remote server.
666
+
When load on demand support is enabled in TreeGrid with paging, the current or active page’s root node alone will be rendered in collapsed state. On expanding the root node, the child nodes will be loaded from the remote server.
667
667
668
668
When a root node is expanded, its child nodes are rendered and are cached locally, such that on consecutive expand/collapse actions on root node, the child nodes are loaded from the cache instead from the remote server.
669
669
@@ -834,11 +834,11 @@ public class SelfReferenceData
834
834
N> * By default, **SfDataManager** uses **ODataAdaptor** for remote data-binding.
835
835
<br/> * Based on the RESTful web services, set the corresponding adaptor to SfDataManager. Refer [here](https://ej2.syncfusion.com/documentation/data/adaptors) for more details.
836
836
<br/> * Filtering and searching server-side data operations are not supported in load on demand.
837
-
<br/> * Only Self-Referential type data is supported with remote data binding in tree grid
837
+
<br/> * Only Self-Referential type data is supported with remote data binding in TreeGrid
838
838
839
-
### Offline mode
839
+
### Enable Offline Mode for Remote Data
840
840
841
-
On remote data binding, all tree grid actions such as paging, loading child on-demand, will be processed on server-side. To avoid postback, set the tree grid to load all data on initialization and make the actions process in client-side. To enable this behavior, use the *offline* property of **SfDataManager**.
841
+
On remote data binding, all TreeGrid actions such as paging, loading child on-demand, will be processed on server-side. To avoid postback, set the TreeGrid to load all data on initialization and make the actions process in client-side. To enable this behavior, use the *offline* property of **SfDataManager**.
842
842
843
843
```cshtml
844
844
@@ -858,17 +858,17 @@ On remote data binding, all tree grid actions such as paging, loading child on-d
858
858
859
859
```
860
860
861
-
### LoadChildOnDemand
861
+
### Load Child Records on Demand
862
862
863
-
The Tree Grid component provides an option to load child records on demand when using remote data binding by setting [LoadChildOnDemand](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_LoadChildOnDemand) to `true`.The behavior of the [LoadChildOnDemand](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_LoadChildOnDemand) feature of Tree Grid are described below.
863
+
The TreeGrid component provides an option to load child records on demand when using remote data binding by setting [LoadChildOnDemand](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_LoadChildOnDemand) to `true`.The behavior of the [LoadChildOnDemand](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_LoadChildOnDemand) feature of TreeGrid are described below.
864
864
865
865
* The parent records are rendered in an **collapsed** state.
866
866
867
867
* Child records are loaded only when the corresponding parent records are **expanded**.
868
868
869
869
This feature is particularly useful for applications that have a large number of child records. If we want the child records to be readily accessible without additional user interaction for expanding nodes, we need to set **LoadChildOnDemand*** to **false**.
870
870
871
-
The following code example describes the behavior of the `LoadChildOnDemand` feature of Tree Grid.
871
+
The following code example describes the behavior of the `LoadChildOnDemand` feature of TreeGrid.
872
872
873
873
{% tabs %}
874
874
@@ -1118,7 +1118,7 @@ You can create your own adaptor by extending the built-in adaptors. The followin
1118
1118
1119
1119
### Sending additional parameters to the Rest Web Services
1120
1120
1121
-
To add a custom parameter to the data request, use the **addParams** method of **Query**. Assign the **Query** object with additional parameters to the tree grid [Query](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_Query) property.
1121
+
To add a custom parameter to the data request, use the **addParams** method of **Query**. Assign the **Query** object with additional parameters to the TreeGrid [Query](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_Query) property.
1122
1122
1123
1123
```cshtml
1124
1124
@@ -1163,19 +1163,19 @@ To add a custom parameter to the data request, use the **addParams** method of *
1163
1163
1164
1164
<!--Handling HTTP error
1165
1165
1166
-
During server interaction from the tree grid, some server-side exceptions may occur, and you can acquire those error messages or exception details
1166
+
During server interaction from the TreeGrid, some server-side exceptions may occur, and you can acquire those error messages or exception details
1167
1167
in the client-side using the [`ActionFailure`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.TreeGridEvents-1.html#Syncfusion_Blazor_TreeGrid_TreeGridEvents_1_OnActionFailure) event.
1168
1168
1169
1169
The argument passed to the [`ActionFailure`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.TreeGridEvents-1.html#Syncfusion_Blazor_TreeGrid_TreeGridEvents_1_OnActionFailure) event contains the error details returned from the server.
1170
1170
1171
1171
> The [`ActionFailure`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.TreeGridEvents-1.html#Syncfusion_Blazor_TreeGrid_TreeGridEvents_1_OnActionFailure) event will be triggered not only for the server errors, but
1172
-
also when there is an exception while processing the tree grid actions.
1172
+
also when there is an exception while processing the TreeGrid actions.
1173
1173
1174
1174
-->
1175
1175
1176
1176
## Entity Framework
1177
1177
1178
-
Follow the below steps to consume data from the **Entity Framework** in the Tree Grid component.
1178
+
Follow the below steps to consume data from the **Entity Framework** in the TreeGrid component.
### Configure Tree Grid component using Web API adaptor
1314
+
### Configure TreeGrid component using Web API adaptor
1315
1315
1316
-
Now, the Tree Grid can be configured using the **'SfDataManager'** to interact with the created Web API and consume the data appropriately. To interact with web API, use WebApiAdaptor.
1316
+
Now, the TreeGrid can be configured using the **'SfDataManager'** to interact with the created Web API and consume the data appropriately. To interact with web API, use WebApiAdaptor.
1317
1317
1318
1318
```cshtml
1319
1319
@usingSyncfusion.Blazor.Grids
@@ -1342,6 +1342,6 @@ Now, the Tree Grid can be configured using the **'SfDataManager'** to interact w
1342
1342
}
1343
1343
```
1344
1344
1345
-
To perform Tree Grid CRUD operation using Entity Framework. You can refer [here](https://blazor.syncfusion.com/documentation/treegrid/editing/entity-frame-work).
1345
+
To perform TreeGrid CRUD operation using Entity Framework. You can refer [here](https://blazor.syncfusion.com/documentation/treegrid/editing/entity-frame-work).
1346
1346
1347
1347
N> You can find the fully working sample [here](https://github.com/SyncfusionExamples/Blazor-TreeGrid-With-EntityFramework).
Copy file name to clipboardExpand all lines: blazor/treegrid/excel-export.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,15 @@
1
1
---
2
2
layout: post
3
3
title: Excel Export in Blazor TreeGrid Component | Syncfusion
4
-
description: Checkout and learn here all about excel export in Syncfusion Blazor TreeGrid component and much more.
4
+
description: Learn how to export TreeGrid data to Excel in the Syncfusion Blazor TreeGrid component and much more.
5
5
platform: Blazor
6
-
control: Tree Grid
6
+
control: TreeGrid
7
7
documentation: ug
8
8
---
9
9
10
10
# Excel Export in Blazor TreeGrid Component
11
11
12
-
The excel export allows exporting Tree Grid data to Excel document. Use the
13
-
**ExportToExcelAsync** method for exporting. To enable Excel export in the Tree Grid, set the [AllowExcelExport](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_AllowExcelExport) property as true.
14
-
15
-
To know about exporting tree grid data to Excel document in Blazor tree grid component, you can check on this video.
12
+
The Excel export feature allows exporting TreeGrid data to an Excel document using the **ExportToExcelAsync** method. To enable Excel export, set the [AllowExcelExport](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeGrid.SfTreeGrid-1.html#Syncfusion_Blazor_TreeGrid_SfTreeGrid_1_AllowExcelExport) property to `true`.
Microsoft Excel permits up to seven nested levels in outlines. So that in the Tree Grid we can able to provide only up to seven nested levels and if it exceeds more than seven levels then the document will be exported without outline option. Refer the [Microsoft Limitation](https://learn.microsoft.com/en-us/sql/reporting-services/report-builder/exporting-to-microsoft-excel-report-builder-and-ssrs?view=sql-server-2017#ExcelLimitations).
529
+
## Limitations
530
+
531
+
Microsoft Excel supports up to **seven nested levels** in outlines. If the TreeGrid exceeds this depth, the document will be exported without outline formatting.
0 commit comments