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. Image for the cookie policy date

Highlighting a row in GridGroupingControl

Hi,

The following statement works fine for numeric values. It matches rows perfectly.

gridConditionalFormatDescriptor1.Expression = "[amount]=100"

But when I have to compare string value it fails.
For e.g I have one column in grid called "item". And I have to highlight all records having value equal to "i1".

Will you please explain how following statement should be completed for "item" = "i1"?
gridConditionalFormatDescriptor1.Expression =


Thanks and Regards,
Vinod

1 Reply

AD Administrator Syncfusion Team December 4, 2006 07:51 AM UTC

Hi Vinod,

Please try the 'Like' operator to format the grid using GridConditionalFormatDescriptor. The following code sets the TextColor/BackColor of those record field cells whose Col1 values equal to 'W'’:

GridConditionalFormatDescriptor Descriptor1 = new GridConditionalFormatDescriptor();
Descriptor1.Appearance.AnyRecordFieldCell.TextColor = Color.Red;
Descriptor1.Appearance.AnyRecordFieldCell.BackColor = Color.AliceBlue;

Descriptor1.Expression = "[Col1] Like 'W'";

this.gridGroupingControl1.TableDescriptor.ConditionalFormats.Add(Descriptor1);

Please refer to the attached sample for implementation.
GGCConditionalFormatSample.zip

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon