Skip to content

documentation(888757): databinding changes #3013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,65 @@ N>Remote Data Binding supports only Self-Referential Data and by default the `pa
{% endtabs %}
{% endif %}


**Service code snippet:**

```ts

namespace Controllers
{
[Produces("application/json")]
[Route("api/SelfReferenceData")]
public class SelfReferenceDataController : Controller
{
public static List<SelfReferenceData> tree = new List<SelfReferenceData>();
// GET: api/SelfReferenceData
[HttpGet]

public object Get()
{
var queryString = Request.Query;
if (tree.Count == 0)
tree = SelfReferenceData.GetTree();
//Filtering
if (queryString.Keys.Contains("$filter") && !queryString.Keys.Contains("$top"))
{
StringValues filter;
queryString.TryGetValue("$filter", out filter);
int fltr = Int32.Parse(filter[0].ToString().Split("eq")[1]);
IQueryable<SelfReferenceData> data1 = tree.Where(f => f.ParentItem == fltr).AsQueryable();
return new { result = data1.ToList(), count = data1.Count() };
}
List<SelfReferenceData> data = tree.ToList();
if (queryString.Keys.Contains("$select"))
{
data = (from ord in tree
select new SelfReferenceData
{
ParentItem = ord.ParentItem
}
).ToList();
return data;
}
data = data.Where(p => p.ParentItem == null).ToList();
int count = data.Count;
//Paging
if (queryString.Keys.Contains("$inlinecount"))
{
StringValues Skip;
StringValues Take;

int skip = (queryString.TryGetValue("$skip", out Skip)) ? Convert.ToInt32(Skip[0]) : 0;
int top = (queryString.TryGetValue("$top", out Take)) ? Convert.ToInt32(Take[0]) : data.Count();

return new { result = tree.Skip(skip).Take(top), count = tree.Count };
}
else
{
return SelfReferenceData.GetTree();
}
}

```

N> By default, **DataManager** uses **ODataAdaptor** for remote data-binding.
<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.
Expand Down
10 changes: 9 additions & 1 deletion ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/getting-started-mvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,12 @@ By default, filtered records are shown along with its parent records. This behav

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

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.
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.

* [Getting Started with Syncfusion JavaScript documentation](https://ej2.syncfusion.com/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion JavaScript (ES5) documentation](https://ej2.syncfusion.com/javascript/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion Angular documentation](https://ej2.syncfusion.com/angular/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion React documentation](https://ej2.syncfusion.com/react/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion ASP.NET Core documentation](https://ej2.syncfusion.com/aspnetcore/documentation/tree-grid/getting-started-core)
* [Getting Started with Syncfusion Vue documentation](https://ej2.syncfusion.com/vue/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion Blazor documentation](https://blazor.syncfusion.com/documentation/treegrid/getting-started-webapp)
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,65 @@ N>Remote Data Binding supports only Self-Referential Data and by default the `pa
{% endif %}


**Service code snippet:**

```ts

namespace Controllers
{
[Produces("application/json")]
[Route("api/SelfReferenceData")]
public class SelfReferenceDataController : Controller
{
public static List<SelfReferenceData> tree = new List<SelfReferenceData>();
// GET: api/SelfReferenceData
[HttpGet]

public object Get()
{
var queryString = Request.Query;
if (tree.Count == 0)
tree = SelfReferenceData.GetTree();
//Filtering
if (queryString.Keys.Contains("$filter") && !queryString.Keys.Contains("$top"))
{
StringValues filter;
queryString.TryGetValue("$filter", out filter);
int fltr = Int32.Parse(filter[0].ToString().Split("eq")[1]);
IQueryable<SelfReferenceData> data1 = tree.Where(f => f.ParentItem == fltr).AsQueryable();
return new { result = data1.ToList(), count = data1.Count() };
}
List<SelfReferenceData> data = tree.ToList();
if (queryString.Keys.Contains("$select"))
{
data = (from ord in tree
select new SelfReferenceData
{
ParentItem = ord.ParentItem
}
).ToList();
return data;
}
data = data.Where(p => p.ParentItem == null).ToList();
int count = data.Count;
//Paging
if (queryString.Keys.Contains("$inlinecount"))
{
StringValues Skip;
StringValues Take;

int skip = (queryString.TryGetValue("$skip", out Skip)) ? Convert.ToInt32(Skip[0]) : 0;
int top = (queryString.TryGetValue("$top", out Take)) ? Convert.ToInt32(Take[0]) : data.Count();

return new { result = tree.Skip(skip).Take(top), count = tree.Count };
}
else
{
return SelfReferenceData.GetTree();
}
}

```

N> By default, **DataManager** uses **ODataAdaptor** for remote data-binding.
<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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,4 +615,12 @@ N> [View Sample in GitHub](https://github.com/SyncfusionExamples/ASP-NET-Core-Ge
## See also

* [Getting Started with Syncfusion ASP.NET Core using Razor Pages](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/razor-pages/)
* [Getting Started with Syncfusion ASP.NET Core MVC using Tag Helper](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/aspnet-core-mvc-taghelper)
* [Getting Started with Syncfusion ASP.NET Core MVC using Tag Helper](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/aspnet-core-mvc-taghelper)

* [Getting Started with Syncfusion JavaScript documentation](https://ej2.syncfusion.com/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion JavaScript (ES5) documentation](https://ej2.syncfusion.com/javascript/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion Angular documentation](https://ej2.syncfusion.com/angular/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion React documentation](https://ej2.syncfusion.com/react/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion ASP.NET Core documentation](https://ej2.syncfusion.com/aspnetcore/documentation/tree-grid/getting-started-core)
* [Getting Started with Syncfusion Vue documentation](https://ej2.syncfusion.com/vue/documentation/treegrid/getting-started)
* [Getting Started with Syncfusion Blazor documentation](https://blazor.syncfusion.com/documentation/treegrid/getting-started-webapp)
6 changes: 4 additions & 2 deletions ej2-asp-core-mvc/tree-grid/overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: Overview in ##Platform_Name## Tree Grid Component
title: Overview in ##Platform_Name## Tree Grid Component | Syncfusion
description: Learn here all about Overview in Syncfusion ##Platform_Name## Tree Grid component of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Index
Expand All @@ -9,7 +9,7 @@ documentation: ug
---


# Overview
# Overview in ##Platform_Name## Tree Grid Component

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.

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

* **Data sources**: Binds the TreeGrid component with an array of JavaScript objects or DataManager.
* **Adaptive Layout**: The Tree Grid user interface (UI) has been redesigned to provide an optimal viewing experience and improve usability on small screens.
* **Sorting**: Supports **n** levels of sorting.
* **Filtering**: Supports filtering records with filter bar and menu filtering modes.
* **Paging**: Allows easy switching between pages using the pager bar.
* **Editing**: Offers cell and row editing modes for updating the records.
* **Virtual scrolling**: To efficiently handle and display a large amount of data without experiencing any performance degradation.
* **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.
* **Reordering**: Allows dragging and dropping of any column anywhere in the treegrid’s column header row, thus allowing repositioning of columns.
* **Resizing**: Resizing allows changing column width on the fly by simply dragging the right corner of the column header.
Expand Down
3 changes: 1 addition & 2 deletions ej2-asp-core-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,6 @@
<li><a href="/ej2-asp-core/grid/how-to/hide-sorting-in-excel-filter">Hide sorting options on Excel filter Dialog</a></li>
<li><a href="/ej2-asp-core/grid/how-to/grid-print">Add a title to the header when using Grid print function</a></li>
<li><a href="/ej2-asp-core/grid/how-to/add-params-for-filtering">Customizing Filter Dialog by using an additional Parameter</a></li>
<li><a href="/ej2-asp-core/grid/how-to/customize-the-empty-record-template">Customize the empty record template</a></li>
</ul>
</li>
<li>
Expand Down Expand Up @@ -2755,7 +2754,7 @@
</ul>
</li>

<li>Tree Grid
<li><a href="/ej2-asp-core/tree-grid/overview">Tree Grid</a>
<ul>
<li><a href="/ej2-asp-core/tree-grid/getting-started-core">Getting Started</a></li>
<li><a href="/ej2-asp-core/tree-grid/data-binding/data-binding-core">Data Binding</a>
Expand Down
3 changes: 1 addition & 2 deletions ej2-asp-mvc-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,6 @@
<li><a href="/ej2-asp-mvc/grid/how-to/hide-sorting-in-excel-filter">Hide sorting options on Excel filter Dialog</a></li>
<li><a href="/ej2-asp-mvc/grid/how-to/grid-print">Add a title to the header when using Grid print action</a></li>
<li><a href="/ej2-asp-mvc/grid/how-to/add-params-for-filtering">Customizing Filter Dialog by using an additional Parameter</a></li>
<li><a href="/ej2-asp-mvc/grid/how-to/customize-the-empty-record-template">Customize the empty record template</a></li>
</ul>
</li>
<li>
Expand Down Expand Up @@ -2717,7 +2716,7 @@
</ul>
</li>

<li>Tree Grid
<li><a href="/ej2-asp-mvc/tree-grid/overview">Tree Grid</a>
<ul>
<li><a href="/ej2-asp-mvc/tree-grid/getting-started-mvc">Getting Started</a></li>
<li><a href="/ej2-asp-mvc/tree-grid/data-binding/data-binding">Data Binding</a>
Expand Down