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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

119176 May 18,2015 02:51 PM May 20,2015 12:11 PM WinRT 3
loading
Tags: SfDataGrid
Vasanth
Asked On May 18, 2015 02:51 PM

Hi,
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. 

Thanks,
Vasanth

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


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.

Regards,

Jayaleshwari N.



Vasanth
Replied On May 19, 2015 02:05 PM

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.

Thanks,
Vasanth

Attachment: SfDataGridWithStackedHeaders_fbfbc766.zip

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

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.

Regards,

Jayaleshwari N.



CONFIRMATION

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.

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.

;