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
close icon

Override a column style with conditional format

Dear Sir,
In Grid.Grouping; If I override a grid appearance style (grid level) with a conditional format style it applied successfully, but when I try to override the style of a column (column level) with a conditional Format style which is not applicable on that column only and it applied on the rest of the columns which inherits the grid style.

How to overrides a column style with conditional format??

in the attachment, i need to apply red color on the whole row regardless of any other style on any column.

Please help!




Untitled_8d2e11d4.rar

1 Reply

NR Nirmal Raja Syncfusion Team December 7, 2010 12:39 PM UTC

Hi Bandar,

Thank you for your interest in Syncfusion products.

I am able to see the behavior of the Appearance object in ColumnDescriptor which overrides the setting provides in the conditional format. To have the ConditionalFormat over the column appearance, you can use the QueryCellStyleInfo event and apply the same conditions by getting the values individually as a work around.

Please refer the code below:
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
object value1 = e.TableCellIdentity.DisplayElement.ParentRecord.GetValue('FirstName');
object value2 = e.TableCellIdentity.DisplayElement.ParentRecord.GetValue('ID');
if (value1.ToString() == 'Charlotte' && value2.ToString() == '1')
{
e.Style.TextColor = Color.Chocolate;
e.Style.BackColor = Color.Purple;
}
}
}

Also, refer the sample attached in the below location:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCGenericFormat-1901341647.zip

Regards,
Nirmal


Loader.
Live Chat Icon For mobile
Up arrow icon