10434 : Timebased Background color in TimeItemArea


I am trying to color the background of the timeitemarea, with different colors for holidays, by looping all the rows in the gantt. I have viewed the article at

http://plexityhide.dyndns.org/InstantKB13/Article.aspx?id=10066 and http://plexityhide.dyndns.org/InstantKB13/article.aspx?id=10278 , but the solutions are a colored background for the same holiday throughout all the rows in the grid.

I can’t make use of the event OnDateScalerPaintBackground as I do not want the same days to be colored for the different rows in the grid. I have tried to perform coloring on the background through the event OnTimeItemAreaPaintBackground but the result obtained was only one row of colored background. Is there any property I could use to obtain the top position for each row, while looping, so that I can perform the coloring row by row? Or is there any better way to achieve what I wanted?


I think you should continue to use OnTimeItemAreaPaintBackground, loop thru the GanttRows and for each check its draw rect with IphGantRow3.GetRect

Leave a Reply