Parent expander (ToggleButton) color style

3 posts, 1 answers
  1. Matt
    Matt avatar
    17 posts
    Member since:
    Apr 2009

    Posted 27 Jun 2013 Link to this post

    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. Answer
    Masha
    Admin
    Masha avatar
    355 posts

    Posted 02 Jul 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Matt
    Matt avatar
    17 posts
    Member since:
    Apr 2009

    Posted 13 Jul 2013 Link to this post

    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.
Back to Top