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

ConditionalFormats with Date cols

Thread ID:





75448 Jul 25,2008 03:18 PM UTC Jul 31,2008 09:36 AM UTC WinForms 3
Tags: GridControl
reza fotovat
Asked On July 25, 2008 03:18 PM UTC


I did great ConditionalFormats for coloring the rows with all cols type but I dont know hoe to out the Date And time NOW value in conditions,

I want to format rows with date col < NOW

Administrator [Syncfusion]
Replied On July 25, 2008 10:15 PM UTC

Try code like:

GridConditionalFormatDescriptor cfd = new GridConditionalFormatDescriptor();
cfd.Expression = "[dateColumn] BETWEEN {,TODAY}";
cfd.Appearance.AnyRecordFieldCell.BackColor = Color.Red; this.gridGroupingControl1.TableDescriptor.ConditionalFormats.Add(cfd);

Here is a paragraph from the Grouping User Guide on working with dates in expressions.

between - Checks if a date field value between the two values is listed in the right-hand operand. For example, [date] between {2/25/2004, 3/2/2004} returns 1 for any record whose date field is greater than or equal to 2/25/2004 and less than 3/2/2004. To represent the current date, use the token TODAY. To represent DateTime.MinValue, leave the first argument empty. To represent DateTime.MaxValue, leave the second argument empty.

reza fotovat
Replied On July 30, 2008 06:53 AM UTC

Hi, Thanks for your reply

But I want to check the "Date" and "time" , today in only act on date not time

and I want to mark cols .value bigger than a "NOW"


Administrator [Syncfusion]
Replied On July 31, 2008 09:36 AM UTC

One way you can do this is to use a custom FilterCondition. To do this, you create an object that implements ICustomFilter and use this when you set up your FilterCondition. Here is minimal sample that marks rows with date greater than DateTime.Now as red.



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