Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
11621 | Mar 11,2004 05:43 PM UTC | Dec 10,2004 10:21 AM UTC | WinForms | 8 |
![]() |
Tags: Grouping |
//color rows and alternates rows if their Age value is between 30 and 40.
GridConditionalFormatDescriptor format = new GridConditionalFormatDescriptor("specialColor");
format.Expression = "[Age] > 30 And [Age] < 40";
format.Appearance.AlternateRecordFieldCell.BackColor = Color.LightGoldenrodYellow;
format.Appearance.AnyRecordFieldCell.BackColor = Color.LightBlue;
this.gridGroupingControl1.TableDescriptor.ConditionalFormats.Add(format);
GroupingDataSample_3560.zip
''OK is a checkbox column
format.Expression = "[OK] LIKE ''true''"
''states that start with N
format.Expression = "[State] LIKE ''N*''"
''only NC
format.Expression = "[State] LIKE ''NC''"
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 or equal 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.
GridConditionalFormatDescriptor format = new GridConditionalFormatDescriptor("Before Dec");
format.Expression = "[CreateDate] between {,2004-12-01}";
format.Appearance.AlternateRecordFieldCell.BackColor = Color.LightGoldenrodYellow;
format.Appearance.AnyRecordFieldCell.BackColor = Color.LightGoldenrodYellow;
this.gridGroupingControl1.TableDescriptor.ConditionalFormats.Add(format);
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.
This page will automatically be redirected to the sign-in page in 10 seconds.