How to set the background color of the column item

2 posts, 0 answers
  1. Jason
    Jason avatar
    2 posts
    Member since:
    Dec 2012

    Posted 14 Dec 2012 Link to this post

    i've read some of the threads in the forum about how to style the item in Ganttview controls,such as the thread "specific color for each type of task " , the thread "Tree column frustrations ", the thread "Adding to GanttView Style "
    but i still can not set the background color of the tree column item as same as the color of the task shown in the example program attachment in the thread "specific color for each type of task",and i can not set the color using DataTemplate for the column.
    Is there any way in the current code to have the TreeColumn item background to be same as the task background color in the list ? How do I get at my data item from within a DataTemplate? The data context doesn't appear to be correct.
    hope for your help
  2. Masha
    Masha avatar
    355 posts

    Posted 19 Dec 2012 Link to this post

    Hello Jason,

    I demonstrated the approach in the attached project. I used DataTemplate of TreeColumnDefinition.CellTemplate and binded  to background color of TexBox element.

            <TextBox Text="{Binding Title, Mode=TwoWay}" Background="{Binding OriginalEvent.Background}"

    This way each tree column item  is the same color as the event items.
    I hope it helps.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top