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 cell formating with date

Thread ID:





129802 Apr 4,2017 01:07 PM UTC Apr 5,2017 06:20 AM UTC ASP.NET Web Forms 1
Tags: Grid
Asked On April 4, 2017 01:07 PM UTC


i am using your sample http://asp.syncfusion.com/demos/web/grid/conditionalformatting.aspx

How can i do to have celle with a date < now in formated with red text ?

Thank you !

Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 5, 2017 06:20 AM UTC

Hi Guyot, 

Thanks for contacting Syncfusion support. 

To achieve your requirement, use queryCellInfo event of ejGrid. In this event we check the condition with the column and apply the css based on the mentioned condition.  

Find code example, screenshot and sample:  

         <ej:Grid ID="FlatGrid" runat="server" AllowSorting="True" AllowPaging="True"> 
            <ClientSideEvents QueryCellInfo="formatingCell" /> 
                <ej:Column Field="OrderDate" HeaderText="Order Date" TextAlign="Right" Width="80" Format="{0:MM/dd/yyyy}" Priority="2" /> 

    function formatingCell(args) { 
        if (args.column.field == "OrderDate") { 
            var date = args.data.OrderDate; 
            var currentDate = new Date(); 
            if (date < currentDate) { 
                $(args.cell).css("color", "red"); 



Refer to the Help document for the queryCellInfo event.  

Prasanna Kumar N.S.V 


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