This is a migrated thread and some comments may be shown as answers.

How to set the background color of the column item

1 Answer 139 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 15 Dec 2012, 03:40 AM
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

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 19 Dec 2012, 09:35 AM
Hello Jason,

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

<telerik:TreeColumnDefinition.CellTemplate>
    <DataTemplate>
        <TextBox Text="{Binding Title, Mode=TwoWay}" Background="{Binding OriginalEvent.Background}"
                 Opacity="0.5"/>
    </DataTemplate>
</telerik:TreeColumnDefinition.CellTemplate>

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

All the best,
Maria
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GanttView
Asked by
Jason
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or