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

When looping thru ggc.Table.Records, how can I tell that a records meets my Conditional Format Descriptor

Thread ID:





67447 Aug 18,2007 10:43 AM UTC Aug 20,2007 06:53 AM UTC WinForms 1
Tags: Grouping
James Blibo
Asked On August 18, 2007 10:43 AM UTC

I have a ggc in which I have define a GridConditional format to to disabledenable the row based on a certain conditions like...

...Appearance.AnyRecordCell.Enabled = false;

when manually looping thru the record of the gggc that I obtained by ggc.Table.Records, how can I tell if the UI row that this record is bounded to is disabled or enabled, in other words, meets the condition of the Conditional format.

Jeba S [Syncfusion]
Replied On August 20, 2007 06:53 AM UTC

Hi James,

Thank you for your details.

The grid has no collection of records that satisfy a particular conditional format. The formatting for conditional formatting is determined

on demand as the record is drawn in the grid.

So, if you want a collection of such records, then you would have to loop through all the current records in the grid and check the

GridTableViewStyle to see if that particular record has the style applied to it.

Please refer the steps that show how this can be done.

1) This code sets up the formatting and additionally, puts a 1 in the Tag field of the row header cell.

GridConditionalFormatDescriptor gcfd = new GridConditionalFormatDescriptor();
gcfd.Expression = "[Col1] > [Col2]";
gcfd.Appearance.AnyRecordFieldCell.Enabled = false;
gcfd.Appearance.AnyCell.BackColor = Color.Red;
gcfd.Appearance.RowHeaderCell.Tag = 1; //mark the header cell

2) Here is a button handler that loops through all records in the grid to test whether this "1" value is set in the header cell. It simply

points a particular field value in a listbox, but you could create an List or ArrayList of records that satisfy the filter.

private void button1_Click(object sender, EventArgs e)
foreach (GridRecord rec in gridGroupingControl1.Table.FilteredRecords)
int rowIndex = gridGroupingControl1.Table.DisplayElements.IndexOf(rec);
GridTableCellStyleInfo style = gridGroupingControl1.TableControl.GetTableViewStyleInfo(rowIndex, 0); //0 is row header
if (style.Tag != null && style.Tag.Equals(1))

Please refer the sample which implements the above said feature:

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Best Regards,


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