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

Change GridView row style for hover/select

3 Answers 215 Views
GridView
This is a migrated thread and some comments may be shown as answers.
MiroslavStantic
Top achievements
Rank 1
MiroslavStantic asked on 21 Jan 2011, 12:40 PM
Hello,

I'm setting the background color of rows in relation to data. Selecting/hovering over rows causes background color to change. This is especially problematic when there is only one row in a grid. There is no way for user to unselect the row and see the data-dependent background color. I would like to leave only the border to indicate selection (or a similar solution that allows for background color to be seen).

I know I need to supply my own style, but I don't know how to do that exactly.

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 21 Jan 2011, 04:42 PM
Hi Miroslav,

 
You may take a look at the following online help article "Override the Default RadGridView Styles".
Please try the approach demonstrated above and let me know if you need any further assistance.


Greetings,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Voss Grose
Top achievements
Rank 1
answered on 16 Apr 2011, 02:16 AM
This article explains how to modify the Template:

http://www.telerik.com/help/silverlight/gridview-styling-a-row.html

It states the following:

You have two options:

  • To create an empty style and set it up on your own.
  • To copy the default style of the control and modify it.

This topic will show you how to perform the second one.


Where is an article on how to do the first one? I would like to avoid bringing in the bulky Template, but need to style the Selected and Hover styles.

thanks.
0
Vanya Pavlova
Telerik team
answered on 16 Apr 2011, 09:27 AM
Hello Voss Grose,

 

When you choose the first option, Expression Blend will generate an empty style for GridViewRow, which you need to set up by your side. Generally this option is useful when you need to create custom row layout.
In order to change the colors when a GridViewRow is in MouseOver and Selected States, you need to change the brushes used in Background_Over and Background_Selected Border elements within its default template as it was demonstrated in the previously referenced help article.


All the best,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
MiroslavStantic
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Voss Grose
Top achievements
Rank 1
Share this question
or