- Home
- Forum
- ASP.NET Core - EJ 2
- Gantt Task background color from database
Gantt Task background color from database
Hi,
I implemented the gantt control with datasource using entity framework, and each project have a color. Is it possible to customize the tasks in gantt to use the project color?
thank you
SIGN IN To post a reply.
4 Replies
LG
Logeswari Gopalakrishnan
Syncfusion Team
April 30, 2020 04:50 PM UTC
Hi Helder,
Yes, it is possible to customize the tasks in Gantt using queryTaskbarInfo event. For this we need to define custom fields in data source and using this field value we can customize the taskbar. Please find the below code example.
|
<ejs-gantt id='RemoteData' queryTaskbarInfo="window.queryTaskbarInfo">
//...
<e-gantt-columns>
//...
<e-gantt-column field="TaskColor" visible="false"></e-gantt-column>
</e-gantt-columns>
</ejs-gantt>
<script type="text/javascript">
window.queryTaskbarInfo = function (args) {
if (args.data.TaskColor)
args.taskbarBgColor = args.data.TaskColor;
}
</script> |
Please find the below sample link.
Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/GanttSample_(5)-361404195
It is also possible to customize the task using taskbar template support.
Documentation - https://ej2.syncfusion.com/aspnetcore/documentation/gantt/appearance-customization/?#taskbar-template
Regards,
Logeswari G
HM
Helder Meneses
April 30, 2020 05:16 PM UTC
Hi,
it's almost there :). The Color comes from the project, the task doesnt have the color column, only project. Is it possible to get the project color column, or do i need to create a column in the task database table and clone the project color?
thank you...
HM
Helder Meneses
April 30, 2020 05:53 PM UTC
I figured out a way to read the project color. It worked flawlessly...
thank you...
PP
Pooja Priya Krishna Moorthy
Syncfusion Team
May 1, 2020 09:05 AM UTC
Hi Helder,
Thanks for your update.
We are happy to hear that your issue has been resolved.
Please get back to us if you require further assistance on this.
Regards,
Pooja K
SIGN IN To post a reply.
- 4 Replies
- 3 Participants
-
HM Helder Meneses
- Apr 30, 2020 12:47 AM UTC
- May 1, 2020 09:05 AM UTC