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.

ConditionalFormats with Date cols

Thread ID:

Created:

Updated:

Platform:

Replies:

75448 Jul 25,2008 11:18 AM Jul 31,2008 05:36 AM Windows Forms 3
loading
Tags: GridControl
reza fotovat
Asked On July 25, 2008 11:18 AM

Hi

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 06:15 PM

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

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"

regards



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

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.

http://www.syncfusion.com/support/user/uploads/WindowsApplication31_11eb0d9c.zip


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.

;