How to change row hover and selection color?

2 posts, 0 answers
  1. Markus
    Markus avatar
    12 posts
    Member since:
    Nov 2013

    Posted 24 Jul 2014 Link to this post

    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:

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

    Any help is very much appreciated.

  2. Yoan
    Yoan avatar
    1215 posts

    Posted 24 Jul 2014 Link to this post

    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.

    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.
Back to Top