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

[Solved] Row selected foreground color

1 Answer 203 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.
Clint Singer
Top achievements
Rank 1
Clint Singer asked on 15 Jan 2010, 01:06 AM
Hi,

I am working on making the RadGridView fairly dark (ie. near black) which means I need to set the cell foreground (for the text) to a lighter color (near white).  I also want to continue using the "Gold" row selection color (I am using full row selection).  Unfortunately the light colored text doesn't show up well over the gold selected background color. 

Is there someway that I can change the color for the foreground text?  From what I can tell the foreground text was designed to be a static color.  I am even willing to update the text color in the code behind on the mouse enter event for the row.

Cheers,
Clint

1 Answer, 1 is accepted

Sort by
0
Accepted
Kalin Milanov
Telerik team
answered on 19 Jan 2010, 11:20 AM
Hi Clint Singer,

There are two ways you can go about and do the desired effect.
One is to wrap the template of the row in a ContentControl, give it a name and change the foreground property in the Selected / MouseOver visual states.
The other way is to do it in code with no template editing required, though it is slower and there is no way of handling the MouseOver state which I believe is a no go for you.

I have also attached a sample illustrating both ways (the code behind is commented) and I leave the final decision to you, though I recommend using the first approach.

I hope you will find the sample useful.

Kind regards,

Kalin Milanov
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Clint Singer
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Share this question
or