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

How to change row hover and selection color?

1 Answer 572 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 24 Jul 2014, 11:45 AM
I implemented a GridView user control (actually a TreeListView control) where I use a custom RowStyleSelector to color specific rows differently based on some GridView cell value. This works just fine.
The problem is that if I hover over a row or select an entire row, the custom color of my RowStyleSelector will be covered. My idea now is to have just a thin border around the entire row as hover or selected row indication instead of a full gradient fill color. That way my specific row color will still be visible.

I found this thread:
http://www.telerik.com/forums/changing-the-highlight-selection-color-for-an-entire-row

Wow, this is quite involved. Isn't there an easier way to achieve what I intend to do?

Any help is very much appreciated.

Thanks,
Markus

1 Answer, 1 is accepted

Sort by
1
Yoan
Telerik team
answered on 24 Jul 2014, 02:09 PM
Hi Markus,

Actually the mentioned forum thread is quite old. However, if you want to change these colors, you need to predefine the template of GridViewRow element. Then you can modify the Selected/MouseOver visual states.

I would suggest to work with our Implicit Styles as demonstrated in this help article. For your convenience, I have prepared a sample project showing you the approach. Please check the changes I made in the Themes/ Telerik.Windows.Controls.GridView.xaml file.

I hope it helps.

Regards,
Yoan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Markus
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or