Skip to content

Commit eff0e7e

Browse files
authored
Merge pull request #3013 from syncfusion-content/888757-datamvccore
documentation(888757): databinding changes
2 parents 1b40b27 + 29ce17b commit eff0e7e

File tree

7 files changed

+142
-9
lines changed

7 files changed

+142
-9
lines changed

ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/data-binding/remote-data.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,65 @@ N>Remote Data Binding supports only Self-Referential Data and by default the `pa
5050
{% endtabs %}
5151
{% endif %}
5252

53-
53+
**Service code snippet:**
54+
55+
```ts
56+
57+
namespace Controllers
58+
{
59+
[Produces("application/json")]
60+
[Route("api/SelfReferenceData")]
61+
public class SelfReferenceDataController : Controller
62+
{
63+
public static List<SelfReferenceData> tree = new List<SelfReferenceData>();
64+
// GET: api/SelfReferenceData
65+
[HttpGet]
66+
67+
public object Get()
68+
{
69+
var queryString = Request.Query;
70+
if (tree.Count == 0)
71+
tree = SelfReferenceData.GetTree();
72+
//Filtering
73+
if (queryString.Keys.Contains("$filter") && !queryString.Keys.Contains("$top"))
74+
{
75+
StringValues filter;
76+
queryString.TryGetValue("$filter", out filter);
77+
int fltr = Int32.Parse(filter[0].ToString().Split("eq")[1]);
78+
IQueryable<SelfReferenceData> data1 = tree.Where(f => f.ParentItem == fltr).AsQueryable();
79+
return new { result = data1.ToList(), count = data1.Count() };
80+
}
81+
List<SelfReferenceData> data = tree.ToList();
82+
if (queryString.Keys.Contains("$select"))
83+
{
84+
data = (from ord in tree
85+
select new SelfReferenceData
86+
{
87+
ParentItem = ord.ParentItem
88+
}
89+
).ToList();
90+
return data;
91+
}
92+
data = data.Where(p => p.ParentItem == null).ToList();
93+
int count = data.Count;
94+
//Paging
95+
if (queryString.Keys.Contains("$inlinecount"))
96+
{
97+
StringValues Skip;
98+
StringValues Take;
99+
100+
int skip = (queryString.TryGetValue("$skip", out Skip)) ? Convert.ToInt32(Skip[0]) : 0;
101+
int top = (queryString.TryGetValue("$top", out Take)) ? Convert.ToInt32(Take[0]) : data.Count();
102+
103+
return new { result = tree.Skip(skip).Take(top), count = tree.Count };
104+
}
105+
else
106+
{
107+
return SelfReferenceData.GetTree();
108+
}
109+
}
110+
111+
```
54112
55113
N> By default, **DataManager** uses **ODataAdaptor** for remote data-binding.
56114
<br/> Based on the RESTful web services, set the corresponding adaptor to DataManager. Refer [`here`](https://ej2.syncfusion.com/documentation/data/adaptors/?no-cache=1) for more details.

ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/getting-started-mvc.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,12 @@ By default, filtered records are shown along with its parent records. This behav
190190

191191
N> [View Sample in GitHub](https://github.com/SyncfusionExamples/ASP-NET-MVC-Getting-Started-Examples/tree/main/TreeGrid/ASP.NET%20MVC%20Razor%20Examples).
192192

193-
N> You can refer to our [ASP.NET MVC Tree Grid](https://www.syncfusion.com/aspnet-mvc-ui-controls/tree-grid) feature tour page for its groundbreaking feature representations. You can also explore our [ASP.NET MVC Tree Grid example](https://ej2.syncfusion.com/aspnetmvc/TreeGrid/Overview#/material) to knows how to present and manipulate data.
193+
N> You can refer to our [ASP.NET MVC Tree Grid](https://www.syncfusion.com/aspnet-mvc-ui-controls/tree-grid) feature tour page for its groundbreaking feature representations. You can also explore our [ASP.NET MVC Tree Grid example](https://ej2.syncfusion.com/aspnetmvc/TreeGrid/Overview#/material) to knows how to present and manipulate data.
194+
195+
* [Getting Started with Syncfusion JavaScript documentation](https://ej2.syncfusion.com/documentation/treegrid/getting-started)
196+
* [Getting Started with Syncfusion JavaScript (ES5) documentation](https://ej2.syncfusion.com/javascript/documentation/treegrid/getting-started)
197+
* [Getting Started with Syncfusion Angular documentation](https://ej2.syncfusion.com/angular/documentation/treegrid/getting-started)
198+
* [Getting Started with Syncfusion React documentation](https://ej2.syncfusion.com/react/documentation/treegrid/getting-started)
199+
* [Getting Started with Syncfusion ASP.NET Core documentation](https://ej2.syncfusion.com/aspnetcore/documentation/tree-grid/getting-started-core)
200+
* [Getting Started with Syncfusion Vue documentation](https://ej2.syncfusion.com/vue/documentation/treegrid/getting-started)
201+
* [Getting Started with Syncfusion Blazor documentation](https://blazor.syncfusion.com/documentation/treegrid/getting-started-webapp)

ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/data-binding/remote-data.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,65 @@ N>Remote Data Binding supports only Self-Referential Data and by default the `pa
5050
{% endif %}
5151

5252

53+
**Service code snippet:**
54+
55+
```ts
56+
57+
namespace Controllers
58+
{
59+
[Produces("application/json")]
60+
[Route("api/SelfReferenceData")]
61+
public class SelfReferenceDataController : Controller
62+
{
63+
public static List<SelfReferenceData> tree = new List<SelfReferenceData>();
64+
// GET: api/SelfReferenceData
65+
[HttpGet]
66+
67+
public object Get()
68+
{
69+
var queryString = Request.Query;
70+
if (tree.Count == 0)
71+
tree = SelfReferenceData.GetTree();
72+
//Filtering
73+
if (queryString.Keys.Contains("$filter") && !queryString.Keys.Contains("$top"))
74+
{
75+
StringValues filter;
76+
queryString.TryGetValue("$filter", out filter);
77+
int fltr = Int32.Parse(filter[0].ToString().Split("eq")[1]);
78+
IQueryable<SelfReferenceData> data1 = tree.Where(f => f.ParentItem == fltr).AsQueryable();
79+
return new { result = data1.ToList(), count = data1.Count() };
80+
}
81+
List<SelfReferenceData> data = tree.ToList();
82+
if (queryString.Keys.Contains("$select"))
83+
{
84+
data = (from ord in tree
85+
select new SelfReferenceData
86+
{
87+
ParentItem = ord.ParentItem
88+
}
89+
).ToList();
90+
return data;
91+
}
92+
data = data.Where(p => p.ParentItem == null).ToList();
93+
int count = data.Count;
94+
//Paging
95+
if (queryString.Keys.Contains("$inlinecount"))
96+
{
97+
StringValues Skip;
98+
StringValues Take;
99+
100+
int skip = (queryString.TryGetValue("$skip", out Skip)) ? Convert.ToInt32(Skip[0]) : 0;
101+
int top = (queryString.TryGetValue("$top", out Take)) ? Convert.ToInt32(Take[0]) : data.Count();
102+
103+
return new { result = tree.Skip(skip).Take(top), count = tree.Count };
104+
}
105+
else
106+
{
107+
return SelfReferenceData.GetTree();
108+
}
109+
}
110+
111+
```
53112
54113
N> By default, **DataManager** uses **ODataAdaptor** for remote data-binding.
55114
<br/> Based on the RESTful web services, set the corresponding adaptor to DataManager. Refer [`here`](https://ej2.syncfusion.com/documentation/data/adaptors/?no-cache=1) for more details.

ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/getting-started-core.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,4 +615,12 @@ N> [View Sample in GitHub](https://github.com/SyncfusionExamples/ASP-NET-Core-Ge
615615
## See also
616616

617617
* [Getting Started with Syncfusion ASP.NET Core using Razor Pages](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/razor-pages/)
618-
* [Getting Started with Syncfusion ASP.NET Core MVC using Tag Helper](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/aspnet-core-mvc-taghelper)
618+
* [Getting Started with Syncfusion ASP.NET Core MVC using Tag Helper](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/aspnet-core-mvc-taghelper)
619+
620+
* [Getting Started with Syncfusion JavaScript documentation](https://ej2.syncfusion.com/documentation/treegrid/getting-started)
621+
* [Getting Started with Syncfusion JavaScript (ES5) documentation](https://ej2.syncfusion.com/javascript/documentation/treegrid/getting-started)
622+
* [Getting Started with Syncfusion Angular documentation](https://ej2.syncfusion.com/angular/documentation/treegrid/getting-started)
623+
* [Getting Started with Syncfusion React documentation](https://ej2.syncfusion.com/react/documentation/treegrid/getting-started)
624+
* [Getting Started with Syncfusion ASP.NET Core documentation](https://ej2.syncfusion.com/aspnetcore/documentation/tree-grid/getting-started-core)
625+
* [Getting Started with Syncfusion Vue documentation](https://ej2.syncfusion.com/vue/documentation/treegrid/getting-started)
626+
* [Getting Started with Syncfusion Blazor documentation](https://blazor.syncfusion.com/documentation/treegrid/getting-started-webapp)

ej2-asp-core-mvc/tree-grid/overview.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: post
3-
title: Overview in ##Platform_Name## Tree Grid Component
3+
title: Overview in ##Platform_Name## Tree Grid Component | Syncfusion
44
description: Learn here all about Overview in Syncfusion ##Platform_Name## Tree Grid component of Syncfusion Essential JS 2 and more.
55
platform: ej2-asp-core-mvc
66
control: Index
@@ -9,7 +9,7 @@ documentation: ug
99
---
1010

1111

12-
# Overview
12+
# Overview in ##Platform_Name## Tree Grid Component
1313

1414
The TreeGrid component is a feature-rich control used to visualize self-referential hierarchical data effectively in a tabular format. It can pull data from data sources such as an array of JSON, RESTful services, `OData services`, `WCF services` or `DataManager`, and binding data fields to columns. It also expands or collapses child data using the tree column.
1515

@@ -18,10 +18,12 @@ The most important features available in the TreeGrid component are paging, sort
1818
## Key features
1919

2020
* **Data sources**: Binds the TreeGrid component with an array of JavaScript objects or DataManager.
21+
* **Adaptive Layout**: The Tree Grid user interface (UI) has been redesigned to provide an optimal viewing experience and improve usability on small screens.
2122
* **Sorting**: Supports **n** levels of sorting.
2223
* **Filtering**: Supports filtering records with filter bar and menu filtering modes.
2324
* **Paging**: Allows easy switching between pages using the pager bar.
2425
* **Editing**: Offers cell and row editing modes for updating the records.
26+
* **Virtual scrolling**: To efficiently handle and display a large amount of data without experiencing any performance degradation.
2527
* **Columns**: The column definitions are used as the datasource schema in the TreeGrid. This plays a vital role in rendering column values in the required tree structure.
2628
* **Reordering**: Allows dragging and dropping of any column anywhere in the treegrid’s column header row, thus allowing repositioning of columns.
2729
* **Resizing**: Resizing allows changing column width on the fly by simply dragging the right corner of the column header.

ej2-asp-core-toc.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,6 @@
13871387
<li><a href="/ej2-asp-core/grid/how-to/hide-sorting-in-excel-filter">Hide sorting options on Excel filter Dialog</a></li>
13881388
<li><a href="/ej2-asp-core/grid/how-to/grid-print">Add a title to the header when using Grid print function</a></li>
13891389
<li><a href="/ej2-asp-core/grid/how-to/add-params-for-filtering">Customizing Filter Dialog by using an additional Parameter</a></li>
1390-
<li><a href="/ej2-asp-core/grid/how-to/customize-the-empty-record-template">Customize the empty record template</a></li>
13911390
</ul>
13921391
</li>
13931392
<li>
@@ -2755,7 +2754,7 @@
27552754
</ul>
27562755
</li>
27572756

2758-
<li>Tree Grid
2757+
<li><a href="/ej2-asp-core/tree-grid/overview">Tree Grid</a>
27592758
<ul>
27602759
<li><a href="/ej2-asp-core/tree-grid/getting-started-core">Getting Started</a></li>
27612760
<li><a href="/ej2-asp-core/tree-grid/data-binding/data-binding-core">Data Binding</a>

ej2-asp-mvc-toc.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,6 @@
13381338
<li><a href="/ej2-asp-mvc/grid/how-to/hide-sorting-in-excel-filter">Hide sorting options on Excel filter Dialog</a></li>
13391339
<li><a href="/ej2-asp-mvc/grid/how-to/grid-print">Add a title to the header when using Grid print action</a></li>
13401340
<li><a href="/ej2-asp-mvc/grid/how-to/add-params-for-filtering">Customizing Filter Dialog by using an additional Parameter</a></li>
1341-
<li><a href="/ej2-asp-mvc/grid/how-to/customize-the-empty-record-template">Customize the empty record template</a></li>
13421341
</ul>
13431342
</li>
13441343
<li>
@@ -2717,7 +2716,7 @@
27172716
</ul>
27182717
</li>
27192718

2720-
<li>Tree Grid
2719+
<li><a href="/ej2-asp-mvc/tree-grid/overview">Tree Grid</a>
27212720
<ul>
27222721
<li><a href="/ej2-asp-mvc/tree-grid/getting-started-mvc">Getting Started</a></li>
27232722
<li><a href="/ej2-asp-mvc/tree-grid/data-binding/data-binding">Data Binding</a>

0 commit comments

Comments
 (0)