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.

Conditional cell formating with date

Thread ID:





129802 Apr 4,2017 09:07 AM Apr 5,2017 02:20 AM ASP.NET Web Forms 1
Tags: Grid
Asked On April 4, 2017 09:07 AM


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 02:20 AM

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.

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.