Changing mouseover effect

2 posts, 0 answers
  1. Sam
    Sam avatar
    17 posts
    Member since:
    Feb 2012

    Posted 17 Apr 2014 Link to this post

    Apologies in advance for what probably is a stupid question. I'm trying to style the GridView and having a difficult time with it. It seems like a lot of the documentation on the website is outdated. For example, this page shows a whole bunch of properties which I do not see in Blend when I follow the exact steps that it outlines.

    To my question: I'm trying to override the default styles and it seems like you have to individually override the style for each component of the gridview, right? I'm currently trying to change the mouse over color. I have the following XAML in my App.xaml:

           <Style x:Key="RadGridViewRowStyle" TargetType="{x:Type telerik:GridViewRow}">
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="Background" Value="White"/>
                <Setter Property="BorderBrush" Value="#FFCBCBCB"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="AllowDrop" Value="True"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="Padding" Value="0"/>
                <Setter Property="SnapsToDevicePixels" Value="True"/>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="{StaticResource MouseOverBrush}"/>
                        <Setter Property="BorderThickness" Value="5"/>
                        <Setter Property="BorderBrush" Value="Black"/>
                    <Trigger Property="IsSelected" Value="True">
                        <Setter Property="Background" Value="{StaticResource SelectedRowBrush}"/>
                        <Setter Property="BorderThickness" Value="5"/>
                        <Setter Property="BorderBrush" Value="Black"/>

    The border changes (which are just for testing) show up, but the background color remains that of the out-of-the-box theme. Any help is appreciated.
  2. Ivan Ivanov
    Ivan Ivanov avatar
    1219 posts

    Posted 18 Apr 2014 Link to this post


    The listed brushes on this page are not properties that can be seen in a style setter. This is a list of the resources that GridViewRow uses in its ControlTemplate. You have either to extract GridViewRow's template with Blend (Editing Control Templates in Expression Blend), or find the respective resource dictionary if you are using Implicit Styles (Editing Control Templates). Then, modify the respective brush (it should be ItemBackground_Over in your case).

    Ivan Ivanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top