From 247e4bf0d258a377e33d1038fccb2e42c288e0ef Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Thu, 5 Jun 2025 18:29:30 +0530 Subject: [PATCH 1/3] documentation(962309):Added sticky header topic. --- .../scrolling/scrolling-sticky-header/razor | 22 +++++++++++++++++ .../scrolling-sticky-header/sticky-header.cs | 6 +++++ .../scrolling-sticky-header/tagHelper | 24 +++++++++++++++++++ .../tree-grid/EJ2_ASP.MVC/scrolling.md | 17 +++++++++++++ .../tree-grid/EJ2_ASP.NETCORE/scrolling.md | 17 +++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/razor create mode 100644 ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs create mode 100644 ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/tagHelper diff --git a/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/razor b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/razor new file mode 100644 index 0000000000..1e5ec4ae52 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/razor @@ -0,0 +1,22 @@ +
+
+ + @Html.EJS().Switch("switch").Change("toggleStickyHeader").Render() +
+
+ @(Html.EJS().TreeGrid("TreeGrid").DataSource((IEnumerable)ViewBag.datasource).Height("100%").Columns(col => + { + col.Field("TaskId").HeaderText("Task ID").Width(90).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add(); + col.Field("TaskName").HeaderText("Task Name").Width(180).Add(); + col.Field("StartDate").HeaderText("Start Date").Format("yMd").Type("date").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width(120).Add(); + col.Field("Duration").HeaderText("Duration").Width(110).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add(); + }).ChildMapping("Children").TreeColumnIndex(1).EnableStickyHeader(true).Render()) + + + + diff --git a/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs new file mode 100644 index 0000000000..a41f3a4b92 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs @@ -0,0 +1,6 @@ +public IActionResult Index() +{ + var tree = TreeGridItems.GetTreeData(); + ViewBag.datasource = tree; + return View(); +} \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/tagHelper b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/tagHelper new file mode 100644 index 0000000000..160634554e --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/tagHelper @@ -0,0 +1,24 @@ + +
+
+ + +
+
+ + + + + + + + +
+
+ + diff --git a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md index 9323933e4b..2491dc757a 100644 --- a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md +++ b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md @@ -76,7 +76,24 @@ Setting the [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/ {% endtabs %} {% endif %} +## Sticky header +The Syncfusion ASP.NET MVC TreeGrid provides a useful feature to keep the column headers fixed (sticky) while scrolling through large datasets. This ensures that the headers remain visible at all times, enhancing user experience by making it easier to understand the context of the data displayed, especially when dealing with wide or long hierarchical data. + +For example, in a project management application, users often need to scroll through a detailed list of tasks and subtasks. When the dataset is large, scrolling down can cause confusion if the column headers scroll out of view, making it difficult to remember what each column represents. By enabling sticky headers, the column headers remain visible even while scrolling, allowing users to easily keep track of the data context. + +To enable sticky headers in the TreeGrid, you can simply set the `EnableStickyHeader` property to **true**. This makes the column headers stick to the top of the TreeGrid container or its parent scrolling container when you scroll vertically. + +The following sample demonstrates how to enable or disable the sticky header in the TreeGrid using a [Switch](https://ej2.syncfusion.com/aspnetmvc/documentation/switch/getting-started) and its [Change](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Buttons.Switch.html#Syncfusion_EJ2_Buttons_Switch_Change) event: + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/razor %} +{% endhighlight %} +{% highlight c# tabtitle="sticky-header.cs" %} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs%} +{% endhighlight %} +{% endtabs %} ## Scroll to selected row diff --git a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md index 7402a49635..aa19ad02cb 100644 --- a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md +++ b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md @@ -75,7 +75,24 @@ Specify the [`width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/S {% endtabs %} {% endif %} +## Sticky header +The Syncfusion ASP.NET MVC TreeGrid provides a useful feature to keep the column headers fixed (sticky) while scrolling through large datasets. This ensures that the headers remain visible at all times, enhancing user experience by making it easier to understand the context of the data displayed, especially when dealing with wide or long hierarchical data. + +For example, in a project management application, users often need to scroll through a detailed list of tasks and subtasks. When the dataset is large, scrolling down can cause confusion if the column headers scroll out of view, making it difficult to remember what each column represents. By enabling sticky headers, the column headers remain visible even while scrolling, allowing users to easily keep track of the data context. + +To enable sticky headers in the TreeGrid, you can simply set the `EnableStickyHeader` property to **true**. This makes the column headers stick to the top of the TreeGrid container or its parent scrolling container when you scroll vertically. + +The following sample demonstrates how to enable or disable the sticky header in the TreeGrid using a [Switch](https://ej2.syncfusion.com/aspnetmvc/documentation/switch/getting-started) and its [Change](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Buttons.Switch.html#Syncfusion_EJ2_Buttons_Switch_Change) event: + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="sticky-header.cs" %} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs%} +{% endhighlight %} +{% endtabs %} ## Scroll to selected row From 1f73264f3d5064119ccaa6c5b4ae149f245ded01 Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Thu, 5 Jun 2025 18:53:38 +0530 Subject: [PATCH 2/3] documentation(962309):Added sticky header topic. --- ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md index 2491dc757a..e51ffbaf4c 100644 --- a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md +++ b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md @@ -1,6 +1,6 @@ --- layout: post -title: Scrolling in ##Platform_Name## Tree Grid Component +title: Scrolling in Syncfusion ##Platform_Name## Tree Grid Component description: Learn here all about Scrolling in Syncfusion ##Platform_Name## Tree Grid component of Syncfusion Essential JS 2 and more. platform: ej2-asp-core-mvc control: Scrolling From 180e5dbd6ae106ecd4af4ce1ab63da4869b4bd54 Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Mon, 9 Jun 2025 10:55:55 +0530 Subject: [PATCH 3/3] documentation(962309):Updated --- ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md index aa19ad02cb..573a8d8eae 100644 --- a/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md +++ b/ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md @@ -77,13 +77,13 @@ Specify the [`width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/S ## Sticky header -The Syncfusion ASP.NET MVC TreeGrid provides a useful feature to keep the column headers fixed (sticky) while scrolling through large datasets. This ensures that the headers remain visible at all times, enhancing user experience by making it easier to understand the context of the data displayed, especially when dealing with wide or long hierarchical data. +The Syncfusion ASP.NET Core TreeGrid provides a useful feature to keep the column headers fixed (sticky) while scrolling through large datasets. This ensures that the headers remain visible at all times, enhancing user experience by making it easier to understand the context of the data displayed, especially when dealing with wide or long hierarchical data. For example, in a project management application, users often need to scroll through a detailed list of tasks and subtasks. When the dataset is large, scrolling down can cause confusion if the column headers scroll out of view, making it difficult to remember what each column represents. By enabling sticky headers, the column headers remain visible even while scrolling, allowing users to easily keep track of the data context. -To enable sticky headers in the TreeGrid, you can simply set the `EnableStickyHeader` property to **true**. This makes the column headers stick to the top of the TreeGrid container or its parent scrolling container when you scroll vertically. +To enable sticky headers in the TreeGrid, you can simply set the `enableStickyHeader` property to **true**. This makes the column headers stick to the top of the TreeGrid container or its parent scrolling container when you scroll vertically. -The following sample demonstrates how to enable or disable the sticky header in the TreeGrid using a [Switch](https://ej2.syncfusion.com/aspnetmvc/documentation/switch/getting-started) and its [Change](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Buttons.Switch.html#Syncfusion_EJ2_Buttons_Switch_Change) event: +The following sample demonstrates how to enable or disable the sticky header in the TreeGrid using a [Switch](https://ej2.syncfusion.com/aspnetcore/documentation/switch/getting-started) and its [Change](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Buttons.Switch.html#Syncfusion_EJ2_Buttons_Switch_Change) event: {% tabs %} {% highlight cshtml tabtitle="CSHTML" %}