How to change baseline color for specific tasks in a project for .NET Gantt Chart?
Baselines are used to represent the original start date and end date of a task, scheduled at the beginning of the project. In Gantt, it is possible to render the baseline using RenderBaseLine property and we can define the baseline color using BaselineColor property at load time.
It is also possible to change this color dynamically for some task with the help of queryTaskbarInfo client side event.
The following code example shows you how to enable baseline and change its line color dynamically at run time based on condition in Gantt control.
<ej:Gantt ID="GanttContainer" runat="server" BaselineStartDateMapping="BaselineStartDate" BaselineEndDateMapping="BaselineEndDate" RenderBaseline="true" QueryTaskbarInfo="queryTaskbarInfo"> </ej:Gantt>
<script> function queryTaskbarInfo(args) { if (args.data.taskId == "2" || args.data.taskId == "3") args.baselineBackground = "red"; } </script>
The following screenshot shows the baseline in Gantt control.
Sample link
A sample to render baseline in Gantt is available in the following link, Sample
Note:
A new version of Essential Studio for ASP.NET is available. Versions prior to the release of Essential Studio 2014, Volume 2 will now be referred to as a classic versions.The new ASP.NET suite is powered by Essential Studio for JavaScript providing client-side rendering of HTML 5-JavaScript controls, offering better performance, and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.
The Classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential Studio for ASP.NET. Although Syncfusion will continue to support all Classic Versions, we are happy to assist you in migrating to the newest edition.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below.
You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!