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

Override a column style with conditional format

Thread ID:

Created:

Updated:

Platform:

Replies:

97512 Dec 4,2010 09:57 PM UTC Dec 7,2010 12:39 PM UTC WinForms 1
loading
Tags: GridControl
Bandar Alfatta
Asked On December 4, 2010 09:57 PM UTC

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

Nirmal Raja [Syncfusion]
Replied On 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


CONFIRMATION

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.

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

;