diff --git a/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/data.cs b/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/data.cs new file mode 100644 index 0000000000..eec9005cde --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/data.cs @@ -0,0 +1,5 @@ +public IActionResult Index() +{ + ViewBag.DataSource = GanttData.ProjectNewData(); + return View(); +} \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/razor b/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/razor new file mode 100644 index 0000000000..e8c202c063 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/razor @@ -0,0 +1,20 @@ +@model List + +@Html.EJS().Gantt("Editing").DataSource((IEnumerable)ViewBag.DataSource).QueryTaskbarInfo("queryTaskbarInfo").QueryCellInfo("queryCellInfo").TaskFields(ts => ts.Id("TaskId").Name("TaskName").StartDate( + "StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Dependency("Predecessor").ParentID("ParentId")).EditSettings(es => + es.AllowTaskbarEditing(true)).Render() + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/tagHelper b/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/tagHelper new file mode 100644 index 0000000000..d42857cd9b --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/gantt/taskbar-hide/tagHelper @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/gantt/images/taskbar-hide.png b/ej2-asp-core-mvc/gantt/images/taskbar-hide.png new file mode 100644 index 0000000000..42baa70c75 Binary files /dev/null and b/ej2-asp-core-mvc/gantt/images/taskbar-hide.png differ diff --git a/ej2-asp-core-mvc/gantt/taskbar.md b/ej2-asp-core-mvc/gantt/taskbar.md index 4e31f0609b..0b0567d00f 100644 --- a/ej2-asp-core-mvc/gantt/taskbar.md +++ b/ej2-asp-core-mvc/gantt/taskbar.md @@ -137,6 +137,37 @@ You can change the gripper icon in the taskbar by applying styles to their respe ![Change Gripper Icon in Taskbar](images/change-gripper-icon.png) +### Taskbar and Notes Icon Visibility + +By default, taskbars and notes icons are displayed for all tasks in the Gantt chart. However, there may be scenarios where certain taskbars or notes icons need to be hidden dynamically based on specific conditions. + +This customization can be accomplished using the [`queryTaskbarInfo`](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.gantt.gantt.html#Syncfusion_EJ2_Gantt_Gantt_QueryTaskbarInfo) and [`queryCellInfo`](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.gantt.gantt.html#Syncfusion_EJ2_Gantt_Gantt_QueryCellInfo) events. These events allow fine-grained control over the rendering of taskbars, notes icons, and their corresponding rows, enabling conditional visibility as needed. + +{% if page.publishingplatform == "aspnet-core" %} + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/gantt/taskbar-hide/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="data.cs" %} +{% include code-snippet/gantt/taskbar-hide/data.cs %} +{% endhighlight %} +{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/gantt/taskbar-hide/razor %} +{% endhighlight %} +{% highlight c# tabtitle="data.cs" %} +{% include code-snippet/gantt/taskbar-hide/data.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} + +![Change Gripper Icon in Taskbar](images/taskbar-hide.png) + ## Multi Taskbar support in project view The Gantt component, supports rendering multi-taskbars in the project view. With this feature the parent taskbar, when it is collapsed, visually summarize the progress of all its child taskbars.