[]
In order to highlight important information in rows or columns of a worksheet, DsExcel .NET allows users to create conditional formatting rules for individual cells or a range of cells based on cell values. If the format condition matches with the cell value, it is assumed as true and the cell is formatted as per the specified rule.
For instance, let us assume you want a cell or a range of cells to appear in italics when the value entered in them is lower than 90. To accomplish this, you would apply a conditional formatting rule that will change the format of the cell as soon as the condition is met. Other cells will appear in general format which is the default format of the cells in a spreadsheet.
You can apply conditional formatting in individual cells or a range of cells using rules or conditional operators. The set of conditional formatting rules for a range is represented with the FormatConditions property of the IRange interface.
In addition to standard cell values, DsExcel .NET also supports conditional formatting for cells that contain pictures (rich data type). The following conditional formatting rule types are supported for pictures in cells:
Format Type | Description |
|---|---|
Cell Value Equals / Cell Value Not Equals | Compares the complete RichData value (AltText and ImageData must both match). |
Text Contains / Text Does Not Contain | Operates on the AltText string component only. |
Duplicate Values / Unique Values | Compares the complete RichData value (AltText and ImageData must both match). |
Blanks | Picture cells are not considered blank. |
Errors | Picture cells are not considered errors. |
Formula | Depends on the result of the formula evaluation. |
Shared below is a list of conditional formatting rules that can be applied in a worksheet.
If you want to delete the formatting rule applied to the cell range in a worksheet, you can do it by using the Delete method of IFormatCondition interface