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

Conditional Formatting - Entire row, based in one specific field

Thread ID:





118986 May 1,2015 02:52 PM UTC May 4,2015 10:28 AM UTC ASP.NET Web Forms 1
Tags: Grid
Asked On May 1, 2015 02:52 PM UTC


I have a field with three possible values : 
0 - Not checked
1 - Approved
2 - Not approved

I want to change the entire row color base on this values, like this:
0 - Default
1 - Green
2 - Red

I searched, but again I didn't found anything in the online documentation.

Is there a way to do this?
If the answer is yes, I always prefer server-side events code, send-me a solution in javacript only if there is not a solution for the server-side code.

Thanks again, you guys are awesome.



Balaji Marimuthu [Syncfusion]
Replied On May 4, 2015 10:28 AM UTC

Hi Marcelo,

Thanks for using Syncfusion Products.

We have analyzed and a created sample for your requirement. Please find the sample and the code snippet.
Sample: Sample.zip

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">


<ej:Grid ID="Grid" runat='server' AllowPaging="true" >

<ClientSideEvents QueryCellInfo="querycellinfo" />




<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="ScriptSection">


function querycellinfo(args) {

if (args.column.field == "Number" && args.data.Number == 1)

$($(args.cell).parent()).css("backgroundColor", "Green");/*custom css applied to the row */

if (args.column.field == "Number" && args.data.Number == 2)

$($(args.cell).parent()).css("backgroundColor", "Red");/*custom css applied to the row */



We would like to let you know that we can’t apply the background color to the row base on the values in server side. But we can change the rows background color based on the values by using “QueryCellInfo” client side event. So we suggest you to use the client side event “QueryCellInfo” to achieve your requirement.

Please refer the online documentation for further details.
Documentation: http://www.syncfusion.com/kb/2979/how-to-select-or-highlight-rows-based-on-data

Please let us know if you have any queries.

Balaji Marimuthu


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