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

change text color in GridCell

2 Answers 80 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.
Lukas
Top achievements
Rank 1
Lukas asked on 22 Jun 2012, 04:19 PM
My problem is that we use the JetPack styles which overrides the text color of all our textboxes. While the background of those cells is white, the text color is it now either, because of the JetPack styles.

I've been searching for two hours how to easily set the text color in all the cells, globally, but I couldn't find any solution. Isn't it possible to set a text color for the RadGridViewGrid's content holders? And please not via codebehind. I'd like to do this via a style in a global ResourceDictionary.

Any help would be greatly appreciated.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 25 Jun 2012, 09:16 AM
Hello,

 Thank you for contacting us.

As I have understood your situational is that you have defined implicit styles that are applied for all the TextBoxes.

In order to change the TextBox style for the GridView only, you could define a style for the Resources of the GridView.

<telerik:RadGridView.Resources>
       <Style TargetType="TextBox"/>
</telerik:RadGridView.Resources>

Please check this forum thread for a further reference.

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Lukas
Top achievements
Rank 1
answered on 25 Jun 2012, 11:39 AM
If I put this into my RadGridView.Resources nothing happens. The ReSharper marks this Style as redundat, because it's never used. I think I'd need to reference this style in the ControlTemplate which holds that specific text box, wouldn't I?

edit: I achieved the style I wanted. It's not been the TextBox. It's been the TextBlock.

Thanks!
Tags
GridView
Asked by
Lukas
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Lukas
Top achievements
Rank 1
Share this question
or