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

Changing mouseover effect

1 Answer 1095 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 17 Apr 2014, 08:33 PM
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"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{StaticResource MouseOverBrush}"/>
                    <Setter Property="BorderThickness" Value="5"/>
                    <Setter Property="BorderBrush" Value="Black"/>
                </Trigger>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{StaticResource SelectedRowBrush}"/>
                    <Setter Property="BorderThickness" Value="5"/>
                    <Setter Property="BorderBrush" Value="Black"/>
                </Trigger>
            </Style.Triggers>
        </Style>

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.

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 18 Apr 2014, 09:24 AM
Hi,

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).

Regards,
Ivan Ivanov
Telerik
 

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.

 
Tags
GridView
Asked by
Sam
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or