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

[Solved] Stop Header Column From Highlighting on Mouseover

5 Answers 441 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lindsay
Top achievements
Rank 1
Lindsay asked on 22 Aug 2011, 09:40 PM
Does anyone know how to make the header column stop highlighting on mouse over? It's fine if the data rows highlight.

5 Answers, 1 is accepted

Sort by
0
Jonathon
Top achievements
Rank 1
answered on 22 Aug 2011, 09:48 PM
Hi Lindsay,

To do this you need to go into Blend and get the default style and modify the Control Template of the GridViewHeaderCell. Within the template, there should be something that looks like this:

<Border x:Name="GridViewHeaderCell_Over" BorderBrush="{StaticResource GridView_HeaderOuterBorder_Over}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Opacity="0">
                    <Border Cursor="Hand" BorderBrush="{StaticResource GridView_HeaderInnerBorder_Over}" BorderThickness="0" Background="{StaticResource Background}"/>
                </Border>

By modifying this area, you can remove the mouse_over for the column headers.

Jonathon

0
Lindsay
Top achievements
Rank 1
answered on 24 Aug 2011, 12:32 AM
Hi Jonathon:


I'm not very familiar with Expression Blend and I wasn't able to find the Control Template. Could you please elaborate?

Edit: I'm able to access the GridViewHeaderRowTemplate, but not the individual cell template.


Cheers,
Lindsay
0
Accepted
Jonathon
Top achievements
Rank 1
answered on 25 Aug 2011, 01:52 AM
Hi Lindsay,

This is what I used:

http://www.telerik.com/help/silverlight/gridview-styling-column-headers.html

Best regards,

Jonathon
0
Vanya Pavlova
Telerik team
answered on 25 Aug 2011, 09:27 AM
Hi Lindsay,

 

You may edit the template of GridViewHeaderCell and remove the Border element named Background_Over which appears when the mouse is over each column header.
As Jonathon proposed you may use our online docs for further info.
Furthermore you may also refer to the following help article "Override the Default RadGridView Styles".



All the best,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Lindsay
Top achievements
Rank 1
answered on 29 Aug 2011, 07:34 PM
Thank you for your help. I resolved the issue by commenting out the MouseOver code in the GridVIewHeaderCellTemplate.

<!--<VisualState x:Name="MouseOver">
    <Storyboard>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Over">
            <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderForeground_Selected}"/>
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>
</VisualState>-->
Tags
GridView
Asked by
Lindsay
Top achievements
Rank 1
Answers by
Jonathon
Top achievements
Rank 1
Lindsay
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or