ConditionalFormats with Date cols

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


3 Replies

AD Administrator Syncfusion Team 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.








RF reza fotovat 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"

regards




AD Administrator Syncfusion Team 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.

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


Loader.
Up arrow icon