From 7391fb54f1ddfa92471c4f6069ef67f9d5c1f916 Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Wed, 4 Jun 2025 19:24:56 +0530 Subject: [PATCH 1/6] documentation(956790):Added sticky header topic. --- .../scrolling/scrolling-sticky-header/razor | 21 ++++++++++++++++++ .../scrolling-sticky-header/sticky-header.cs | 6 +++++ .../scrolling-sticky-header/tagHelper | 22 +++++++++++++++++++ .../tree-grid/EJ2_ASP.MVC/scrolling.md | 21 ++++++++++++++---- .../tree-grid/EJ2_ASP.NETCORE/scrolling.md | 20 ++++++++++++++--- 5 files changed, 83 insertions(+), 7 deletions(-) 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..c85829bafb --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/razor @@ -0,0 +1,21 @@ +
+
+ + @Html.EJS().Switch("switch").Change("toggleStickyHeader").Render() +
+
+ @(Html.EJS().TreeGrid("TreeGrid").DataSource((IEnumerable)ViewBag.datasource).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).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..8437418326 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/tree-grid/scrolling/scrolling-sticky-header/tagHelper @@ -0,0 +1,22 @@ +
+
+ + +
+
+ + + + + + + + +
+
+ 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..59f36d18c3 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 @@ -46,8 +46,6 @@ To specify the [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js {% endtabs %} {% endif %} - - ## Responsive with parent container Specify the [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) and [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) as **100%** to make the treegrid element fill its parent container. @@ -76,7 +74,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, each with properties like Task ID, Start Date, Duration, and Status. When the dataset is large, scrolling down can cause confusion if the column headers scroll out of view, making it difficult to remember which column represents which data. By enabling sticky headers, the column titles remain visible even while scrolling, so users can always 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/grid/scrolling/scrolling-sticky-header/razor %} +{% endhighlight %} +{% highlight c# tabtitle="sticky-header.cs" %} +{% include code-snippet/grid/scrolling/scrolling-sticky-header/sticky-header.cs%} +{% endhighlight %} +{% endtabs %} ## Scroll to selected row @@ -104,5 +119,3 @@ You can scroll the treegrid content to the selected row position by using the [` {% endhighlight %} {% endtabs %} {% endif %} - - 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..c9dbd44768 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 @@ -8,7 +8,6 @@ publishingplatform: ##Platform_Name## documentation: ug --- - # Scrolling in Tree Grid Control The scrollbar will be displayed in the treegrid when content exceeds the element [`width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) or [`height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html). The vertical and horizontal scrollbars will be displayed based on the following criteria: @@ -46,8 +45,6 @@ To specify the [`width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js {% endtabs %} {% endif %} - - ## Responsive with parent container Specify the [`width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) and [`height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) as **100%** to make the treegrid element fill its parent container. Setting the [`height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) to **100%** requires the treegrid parent element to have explicit height. @@ -75,7 +72,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, each with properties like Task ID, Start Date, Duration, and Status. When the dataset is large, scrolling down can cause confusion if the column headers scroll out of view, making it difficult to remember which column represents which data. By enabling sticky headers, the column titles remain visible even while scrolling, so users can always 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/grid/scrolling/scrolling-sticky-header/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="sticky-header.cs" %} +{% include code-snippet/grid/scrolling/scrolling-sticky-header/sticky-header.cs%} +{% endhighlight %} +{% endtabs %} ## Scroll to selected row From c6c75d75964b3092ba2cf7a67738ef5189061f99 Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Wed, 4 Jun 2025 19:56:46 +0530 Subject: [PATCH 2/6] documentation(956790):Added sticky header topic. --- .../tree-grid/EJ2_ASP.MVC/scrolling.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 59f36d18c3..a14d004225 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 @@ -11,17 +11,17 @@ documentation: ug # Scrolling -The scrollbar will be displayed in the treegrid when content exceeds the element [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) or [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html). The vertical and horizontal scrollbars will be displayed based on the following criteria: +The scrollbar will be displayed in the treegrid when content exceeds the element [`Width`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Width) or [`Height`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Height). The vertical and horizontal scrollbars will be displayed based on the following criteria: The vertical scrollbar appears when the total height of rows present in the treegrid exceeds its element height. The horizontal scrollbar appears when the sum of columns width exceeds the treegrid element width. -The [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) and [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) are used to set the treegrid height and width, respectively. +The [`Height`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Height) and [`Width`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Width) are used to set the treegrid height and width, respectively. -N> The default value for [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) and [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) is **auto**. +N> The default value for [`Height`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Height) and [`Width`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Width) is **auto**. ## Set width and height -To specify the [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) and [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) of the scroller in the pixel, set the pixel value to a number. +To specify the [`Width`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Width) and [`Height`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Height) of the scroller in the pixel, set the pixel value to a number. {% if page.publishingplatform == "aspnet-core" %} @@ -48,8 +48,8 @@ To specify the [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js ## Responsive with parent container -Specify the [`Width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Width.html) and [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) as **100%** to make the treegrid element fill its parent container. -Setting the [`Height`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~Height.html) to **100%** requires the treegrid parent element to have explicit height. +Specify the [`Width`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Width) and [`Height`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Height) as **100%** to make the treegrid element fill its parent container. +Setting the [`Height`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_Height) to **100%** requires the treegrid parent element to have explicit height. {% if page.publishingplatform == "aspnet-core" %} From 7caafccff442391f6ab64c4d9461655fdb736f71 Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Wed, 4 Jun 2025 20:00:26 +0530 Subject: [PATCH 3/6] documentation(956790):Added sticky header topic. --- ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md | 4 ++-- ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 a14d004225..d9aeda8fc8 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 @@ -86,10 +86,10 @@ The following sample demonstrates how to enable or disable the sticky header in {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/grid/scrolling/scrolling-sticky-header/razor %} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/razor %} {% endhighlight %} {% highlight c# tabtitle="sticky-header.cs" %} -{% include code-snippet/grid/scrolling/scrolling-sticky-header/sticky-header.cs%} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs%} {% endhighlight %} {% endtabs %} 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 c9dbd44768..6f8cddcf10 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 @@ -84,10 +84,10 @@ The following sample demonstrates how to enable or disable the sticky header in {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/grid/scrolling/scrolling-sticky-header/tagHelper %} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="sticky-header.cs" %} -{% include code-snippet/grid/scrolling/scrolling-sticky-header/sticky-header.cs%} +{% include code-snippet/tree-grid/scrolling/scrolling-sticky-header/sticky-header.cs%} {% endhighlight %} {% endtabs %} From 2fe3992dbcc617964defa158bf578aed733ad970 Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Thu, 5 Jun 2025 10:05:04 +0530 Subject: [PATCH 4/6] documentation(956790):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 d9aeda8fc8..119cbbe5d7 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 @@ -95,7 +95,7 @@ The following sample demonstrates how to enable or disable the sticky header in ## Scroll to selected row -You can scroll the treegrid content to the selected row position by using the [`RowSelected`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.TreeGrid.TreeGrid~RowSelected.html) event. +You can scroll the treegrid content to the selected row position by using the [`RowSelected`](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.TreeGrid.TreeGrid.html#Syncfusion_EJ2_TreeGrid_TreeGrid_RowSelected) event. {% if page.publishingplatform == "aspnet-core" %} From 81ecf7fd5c2ae3098408288ca2ed4ffe0e62ec7f Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Thu, 5 Jun 2025 11:21:36 +0530 Subject: [PATCH 5/6] documentation(956790):Added sticky header topic. --- ej2-asp-core-mvc/tree-grid/EJ2_ASP.MVC/scrolling.md | 2 +- ej2-asp-core-mvc/tree-grid/EJ2_ASP.NETCORE/scrolling.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 119cbbe5d7..33cddd66be 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 @@ -78,7 +78,7 @@ Setting the [`Height`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion. 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, each with properties like Task ID, Start Date, Duration, and Status. When the dataset is large, scrolling down can cause confusion if the column headers scroll out of view, making it difficult to remember which column represents which data. By enabling sticky headers, the column titles remain visible even while scrolling, so users can always keep track of the data context. +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. 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 6f8cddcf10..6a60668038 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 @@ -76,7 +76,7 @@ Specify the [`width`](https://help.syncfusion.com/cr/cref_files/aspnetcore-js2/S 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, each with properties like Task ID, Start Date, Duration, and Status. When the dataset is large, scrolling down can cause confusion if the column headers scroll out of view, making it difficult to remember which column represents which data. By enabling sticky headers, the column titles remain visible even while scrolling, so users can always keep track of the data context. +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. From f9d24f5b7943897ed1a4cea2570ef7f5b316eee8 Mon Sep 17 00:00:00 2001 From: JamunaSundaramSF3699 Date: Thu, 5 Jun 2025 14:14:42 +0530 Subject: [PATCH 6/6] documentation(956790):Added sticky header topic. --- .../scrolling/scrolling-sticky-header/razor | 15 +++++---- .../scrolling-sticky-header/tagHelper | 32 ++++++++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) 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 index c85829bafb..1e5ec4ae52 100644 --- 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 @@ -1,21 +1,22 @@
-
- - @Html.EJS().Switch("switch").Change("toggleStickyHeader").Render() -
+
+ + @Html.EJS().Switch("switch").Change("toggleStickyHeader").Render() +
- @(Html.EJS().TreeGrid("TreeGrid").DataSource((IEnumerable)ViewBag.datasource).Columns(col => + @(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).Render()) + }).ChildMapping("Children").TreeColumnIndex(1).EnableStickyHeader(true).Render()) + 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 index 8437418326..160634554e 100644 --- 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 @@ -1,22 +1,24 @@ +
-
- - -
-
- - - - - - - - -
+
+ + +
+
+ + + + + + + + +
+