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

RadGridView Override HighLight / Selection

2 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
BAHNINI
Top achievements
Rank 1
BAHNINI asked on 08 Aug 2012, 03:22 PM
Hi!

I try to override the GridViewRow default style
I read all topics but redefine the template in DataRowStyle degrades performance on scrolling..
What's the good solution to hide de HighLight and the Selection background ??

It's my style (binding object contains the color property) :

<Style x:Key="GridRowStyle" TargetType="telerik:GridViewRow">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsAlternating" Value="true" />
<Condition Property="IsSelected" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGround2}" />
</MultiTrigger>
<!-- Mouse Over / Selectionné -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true" />
<Condition Property="IsMouseOver" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGroundOverAndSelected}" />
</MultiTrigger>
<!-- Mouse Over -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGroundOver}" />
</MultiTrigger>
<!-- Selectionnée -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGroundSelected}" />
</MultiTrigger>
</Style.Triggers>
</Style>

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Aug 2012, 05:38 AM
Hello,

 You can use implicit styles instead explicit for maximum performance. Just remove the x:Key for your style. I suggest you also to check our implicit themes help article for more info about custom look and feel, performance, etc.:
http://www.telerik.com/help/wpf/styling-apperance-implicit-styles-overview.html

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
BAHNINI
Top achievements
Rank 1
answered on 09 Aug 2012, 08:55 AM
Thanks for your answer
I will make changes but I found my problem
Actually I do not know why but when I use a style for the alternation of the lines performences seriously deteriorate. So I calculated the backcolor myself on my binded object and I deleted the alternative style and the problem disappeared
(The alternate style was the same)
Tags
GridView
Asked by
BAHNINI
Top achievements
Rank 1
Answers by
Vlad
Telerik team
BAHNINI
Top achievements
Rank 1
Share this question
or