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

Parent expander (ToggleButton) color style

2 Answers 200 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 2
Matt asked on 27 Jun 2013, 02:30 PM
I have had success setting colors of most things on the GanttView, but the expander toggle button and GanttPresenterSplitter continue to elude me. I can find it with Snoop and see the Path object, modify it, and see the color change. Every combination of style change, however, has failed to work on load. I even went into blend to extract the control template, but nothing there is copy-able (extract-able) like it is with RadGridView; I just get a blank template. Any thoughts would be appreciated. 

I have read over this document http://www.telerik.com/help/wpf/radganttview-styles-and-templates-overview.html, and it talks about the ExpandToggleeButton (ToggleButton) and GanttPresenterSplitter as stylable. They either just don't want to play nice or they need an odd style designation.

The general gist is everything is transparent to common background (which is a dark gradient), over which lies white text and controls; except for the splitter that I wanted solid black; of course it's white

This was tested under 2013 Q2 (6/11) release.

Any thoughts/help would be appreciated.

    <Grid.Resources>
        <Style TargetType="{x:Type telerik:RadGanttView}">
            <Style.Resources>
                <Style TargetType="telerik:ColumnHeaderContainer">
                    <Setter Property="Visibility" Value="Hidden" />
                </Style>
                <Style TargetType="{x:Type ToggleButton}">
                    <Style.Resources>
                        <Style TargetType="Path">
                            <Setter Property="Fill" Value="White" />
                        </Style>
                    </Style.Resources>
                </Style>
                <Style TargetType="Path">
                    <Setter Property="Fill" Value="White" />
                </Style>
                <Style TargetType="telerik:SimpleTreeCellContainer">
                    <Style.Resources>
                        <Style TargetType="{x:Type ToggleButton}">
                            <Style.Resources>
                                <Style TargetType="Path">
                                    <Setter Property="Fill" Value="White" />
                                </Style>
                            </Style.Resources>
                        </Style>
                        <Style TargetType="Path">
                            <Setter Property="Fill" Value="White" />
                        </Style>
                    </Style.Resources>
                    <Setter Property="Path.Fill" Value="White" />
                    <Setter Property="Background" Value="Transparent" />
                    <Setter Property="Foreground" Value="White" />
                </Style>
                <Style TargetType="telerik:TreeCellContainer">
                    <Style.Resources>
                        <Style TargetType="{x:Type ToggleButton}">
                            <Style.Resources>
                                <Style TargetType="Path">
                                    <Setter Property="Fill" Value="White" />
                                </Style>
                            </Style.Resources>
                        </Style>
                        <Style TargetType="Path">
                            <Setter Property="Fill" Value="White" />
                        </Style>
                    </Style.Resources>
                    <Setter Property="Path.Fill" Value="White" />
                    <Setter Property="Background" Value="Transparent" />
                    <Setter Property="Foreground" Value="White" />
                </Style>
                <Style TargetType="telerik:AlternatingBorderContainer">
                    <Setter Property="Background" Value="Transparent" />
                    <Setter Property="Foreground" Value="White" />
                </Style>
                <Style TargetType="telerik:MajorTickContainer">
                    <Setter Property="Foreground" Value="White" />
                </Style>
                <Style TargetType="telerik:GroupTickContainer">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Style>
                <Style TargetType="telerik:GanttPresenterSplitter">
                    <Setter Property="Background" Value="Black" />
                </Style>
                <Style TargetType="telerik:GanttPresenterPanel">
                    <Style.Resources>
                        <Style TargetType="telerik:GanttPresenterSplitter">
                            <Setter Property="Background" Value="Black" />
                        </Style>
                    </Style.Resources>
                </Style>
            </Style.Resources>
        </Style>
    </Grid.Resources>
    <telerik:RadGanttView Margin="0" Name="radGanttView1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="LightGray">
        <telerik:RadGanttView.Columns>
            <telerik:TreeColumnDefinition ColumnWidth="175" Header="Title" MemberBinding="{Binding Title}" />
        </telerik:RadGanttView.Columns>
    </telerik:RadGanttView>
</Grid>

2 Answers, 1 is accepted

Sort by
0
Accepted
Masha
Telerik team
answered on 02 Jul 2013, 08:55 AM
Hi Matt,

I demonstrated how you need to customize the described elements in the attached project.
The "expander toggle button" actually is not toggle button in RadGabttView. It is a path which is part of the control template of SimpleTreeCellContainer and TreeCellHighlightContainer style. Also you need to modify the GanttPresenterSplitterStyle, which is explicitly called in telerik:ResizeControl inside GanttItemPresenter style. I also attached a GanttView ResourceDictainary in the project which contains all stiles and resources for RadGanttView to help you with future customizations.

I hope it will be helpful.


Regards,
Masha
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Matt
Top achievements
Rank 2
answered on 13 Jul 2013, 12:13 PM
Thanks Masha!

That gave me the answers for the expander, and I will research the PresenterSplitter. That appears to be a little more involved, but I have an example that can help give me a starting point. Thanks again.
Tags
GanttView
Asked by
Matt
Top achievements
Rank 2
Answers by
Masha
Telerik team
Matt
Top achievements
Rank 2
Share this question
or