We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is there anyway I can change entire row text color to red?

Thread ID:





119176 May 18,2015 06:51 PM UTC May 20,2015 04:11 PM UTC WinRT 3
Tags: SfDataGrid
Asked On May 18, 2015 06:51 PM UTC

I am wondering if there is anyway I can change an entire row forecolor? I know there are cell template selectors but that only works for single cell, I like to change forecolor for entire row. 


Jayaleshwari N [Syncfusion]
Replied On May 19, 2015 10:00 AM UTC

Hi Vasanth,

Thank you for using Syncfusion Products.

We are unable to understand your query clearly and we require more information on this. Based on your update “can change an entire row forecolor”, we assume that you would like to change the foreground color of the row and it can be changed under following circumstances :

1.    You can apply foreground color to particular row based on row index using RowStyle selector.

2.    Selected row foreground can be changed based on selection border visibility using RowStyle and CellStyle.

We have prepared a sample with above cases. You can download the sample from the following location:

Sample: RowForeground.zip

Please refer the following UG link to know about the styling support of SfDataGrid:

Styling Rows - UG: http://help.syncfusion.com/UG/winrt/index.html#!Documents/stylingrows.htm

Style Selectors - UG: http://help.syncfusion.com/UG/winrt/index.html#!Documents/styleselectors.htm

Please refer the following KB to style the selected row or cell:

KB: http://www.syncfusion.com/kb/2542/how-to-change-background-and-foreground-for-selected-row-or-cell

Please let us know if this solution helps.


Jayaleshwari N.

Replied On May 19, 2015 06:05 PM UTC

Hi Jayaleshwari,
Thanks for your input. I am able to use the RowStyleSelector option to set Foreground color based on some criteria. Its working fine except for CellTemplate column. I am attaching a sample  app created to demonstrate the issue.

Run the app, and you can see that Rows with ID: 1001 will have a Red foreground expect for Name column. Name column is a GridTemplateColumn with a button. Please let me know how can I make the Name color derive same style as its row.


Attachment: SfDataGridWithStackedHeaders_fbfbc766.zip

Jayaleshwari N [Syncfusion]
Replied On May 20, 2015 04:11 PM UTC

Hi Vasanth,

We have analyzed your requirement “Row Style Selector not working for template column”.  It’s the default behavior that the control loaded within the DataTemplate won’t receive the foreground property value from its parent. So, we  suggest you to use CellStyle Selector and Converter for Foreground property of TextBlcok to achieve your requirement.

We have modified the sample as per your requirement. You can download sample from the following location.

Sample: SfDataGridWithStackedHeaders.zip

Please let us know, if this solution helps.


Jayaleshwari N.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon