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

Mouse Over for Grid columns

2 Answers 508 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vikas
Top achievements
Rank 1
Vikas asked on 12 Jan 2015, 08:38 PM
How can i change the mouse over and selected (color after you click on a column)  color for the GridView columns. I am using this to change the default color

<Style TargetType="{x:Type telerik:GridViewHeaderCell}" >
            <Setter Property="FontFamily" Value="Verdana"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="BorderThickness" Value=".2"/>
            <Setter Property="Background"  Value="#FF8CC63F"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="BorderBrush" Value="#FF8CC63F"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>

        <Style TargetType="telerik:GridViewHeaderRow" >
            <Setter Property="Background" Value="#FF8CC63F" />
        </Style>

2 Answers, 1 is accepted

Sort by
0
Vikas
Top achievements
Rank 1
answered on 14 Jan 2015, 03:32 PM
I found another thread that has a solution, but it is creating a different template
<ControlTemplate x:Key="GridViewHeaderCellTemplate" TargetType="telerik:GridViewHeaderCell">

I don't want to change the look of column headers just the back ground, mouse over and when they are clicked, is it not possible to jsut use style triggers to do that.

Thanks
Vikas
0
Boris
Telerik team
answered on 15 Jan 2015, 09:24 AM
Hello Vikas,

In order to change the colors when a GridViewHeaderCell is in MouseOver and Selected States, you need to change the brushes used in GridView_HeaderBackground_Over and GridView_HeaderBackground_Selected border elements within the GridViewHeaderCellTemplate.

For more information about the different brushes used you can check the Styling the Column Headers documentation article.

I hope this helps.

Regards,
Boris
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
Vikas
Top achievements
Rank 1
Answers by
Vikas
Top achievements
Rank 1
Boris
Telerik team
Share this question
or