/winforms-dashboard-apply-conditional-formatting-to-grid-cells

The following example shows how to apply conditional formatting to Grid cells.

Primary LanguageC#OtherNOASSERTION

Dashboard for WinForms - How to Apply Conditional Formatting to Grid Cells

The following example shows how to apply conditional formatting to Grid cells.

Files to Review

Examples Structure

When you launch the example, you see the start form that allows you to invoke a form for the selected format rule. Select the rule and click Show to view how the format rule applies.

Value

View File: ValueConditionForm.cs (VB: ValueConditionForm.vb)

The Value format rule allows you to compare dimension/measure values with predefined static values.

The FormatConditionValue class contains this format rule's settings.

This form shows how to apply conditional formatting settings to Grid cells whose values are greater than, less than or between the specified values.

ValueConditionForm

Top-Bottom and Average

View File: TopAverageConditionForm.cs (VB: TopAverageConditionForm.vb)

The Top-Bottom format rule allows you to highlight a specific number of topmost/bottommost values. This form shows how to apply conditional formatting to the specified number of top/bottom values. The number of values can be specified as an absolute value or a percentage of all values.

The FormatConditionTopBottom class contains this format rule's settings.

The Average format rule allows you to highlight values above or below an average value.

The FormatConditionAverage class contains this format rule's settings.

TopAverageConditionForm

Icon Ranges

View File: IconRangeConditionForm.cs (VB: IconRangeConditionForm.vb)

The Icon Ranges format rule displays a specific icon based on a value range. You can select a predefined set of icons or apply a specific icon to each range.

The FormatConditionRangeSet class contains this format rule's settings.

Click the Update Format Rule button to change the number of ranges, specify new range boundaries and customize icons related to existing ranges.

IconRangeConditionForm

Date Occurring

View File: DateOccurringForm.cs (VB: DateOccurringForm.vb)

The Date Occurring format rule allows you to apply formatting to date-time values of a specific date and/or date interval relative to the current date.

The FormatConditionDateOccurring class contains this format rule's settings.

This form demonstrates how to apply conditional formatting to Grid cells whose values fall into one of the predefined intervals.

DateOccurringForm

Range Gradient

View File: GradientRangeConditionForm.cs (VB: GradientRangeConditionForm.vb)

The Range Gradient format rule allows you to use predefined color gradients to apply conditional formatting to different ranges of values.

The FormatConditionRangeGradient class contains this format rule's settings.

This form shows how to apply the predefined Red-Blue color gradient. Click the Update Format Rule button to change start/end colors and the number of ranges in the color gradient. The third color in the middle of the color scale is also specified to generate a 3-color gradient.

GradientRangeConditionForm

Bar

View File: BarConditionForm.cs (VB: BarConditionForm.vb)

The Bar format rule allows you to visualize numeric values using bars.

The FormatConditionBar class contains this format rule's settings.

This form shows how to display data bars within grid cells. Note that bars corresponding to positive and negative values are colored differently.

BarConditionForm

Bar Color Ranges

View File: RangeColorBarConditionForm.cs (VB: RangeColorBarConditionForm.vb)

The Bar Color Ranges format rule allows you to visualize numeric values using bars whose colors are contained in the specified color set.

The FormatConditionColorRangeBar class contains this format rule's settings.

This form shows how to display colored bars within Grid cells. Click the Update Format Rule button to change the number of ranges, specify new range boundaries and change colors mapped to ranges.

RangeColorBarConditionForm

Bar Gradient Ranges

View File: RangeGradientBarConditionForm.cs (VB: RangeGradientBarConditionForm.vb)

The Bar Gradient Ranges format rule allows you to visualize numeric values using bars whose colors are contained in the specified color gradient.

The FormatConditionGradientRangeBar class contains this format rule's settings.

This example shows how to apply conditional formatting to Grid cells using the predefined Red-Blue color gradient. Click the Update Format Rule button to change start/end colors and the number of ranges in the color gradient. The third color in the middle of the color scale is also specified to generate a 3-color gradient.

RangeGradientBarConditionForm

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)