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

conditional formatting of individual cells

Thread ID:

Created:

Updated:

Platform:

Replies:

63452 Jul 4,2007 10:44 AM UTC Jul 5,2007 09:21 PM UTC WinForms 2
loading
Tags: Tools
flix
Asked On July 4, 2007 10:44 AM UTC

I have a GridGroupingControl, where I want to set the background color of certain cells in ONE column, given certain criteria.

At a quick glance the conditional formatting using the GridConditionalFormatDescriptor would appear to do the job, but on closer inspection, it turns out I can only set properties of entire rows using this.

I would like to avoid using formatting events for this, if possible. What should I do? Should I design a custom celltype that takes some expression or something?

Or should I, every time the CueryCellStyleInfo event is triggered do my checks and fix this?

Thanks!

flix
Replied On July 4, 2007 11:49 AM UTC

By the way, I also tried using the QueryCellFormattedText event, which doesn't trigger quite as often, using

e.style.Background = Color.blue;

with no visible result at all.

Isn't that odd?

>I have a GridGroupingControl, where I want to set the background color of certain cells in ONE column, given certain criteria.

At a quick glance the conditional formatting using the GridConditionalFormatDescriptor would appear to do the job, but on closer inspection, it turns out I can only set properties of entire rows using this.

I would like to avoid using formatting events for this, if possible. What should I do? Should I design a custom celltype that takes some expression or something?

Or should I, every time the CueryCellStyleInfo event is triggered do my checks and fix this?

Thanks!

haneefm [Syncfusion]
Replied On July 5, 2007 09:21 PM UTC

Hi Felix,

You can not just ''set'' cell specific properties (other than the CellValue) in a GridGroupingControl. You can set column wide styles using grid.tableDescriptor.Column[x].Appearance property, you can set conditional row formats by adding ConditionalFormats. See this thread.

http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=26929

that shows you "How to set cell-specific property in a grid?".

In version 5.1, we ship a sample that shows how style settings can be applied dynamically. If you want to provide formatting at run time, the QueryCellStyleInfo event handler is the right place to do that. It provides the GridStyleInfo object for a given cell on demand. This is the event that gets fired, every time a request is made, to access the style information for a cell. It is also used to conditionally change the style for a given cell. Inside this handler, you can apply style settings for a given celltype by using the GridTableCellStyleInfoEventArgs.TableCellIdentity.TableCellType property.Below is a link to this sample.

\Syncfusion\EssentialStudio\5.1.1.0\Windows\Grid.Grouping.Windows\Samples\2.0\Appearance\DynamicFormatting\cs

Best regards,
Haneef

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

;