Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / ConditionalFormattingCellHighlight Class
Example


In This Topic
    ConditionalFormattingCellHighlight Class
    In This Topic
    Represents the Highlight Cells ConditionalFormatting, which highlight Cells corresponding to a specific condition.
    Object Model
    ConditionalFormattingCellHighlight ClassConditionalFormatting ClassConditionalFormatting ClassConditionalFormatting ClassCellHighlightCondition ClassConditionalFormatting ClassConditionalFormatting ClassConditionalFormatting Class
    Syntax
    'Declaration
     
    
    Public Class ConditionalFormattingCellHighlight 
       Inherits ConditionalFormatting
    'Usage
     
    
    Dim instance As ConditionalFormattingCellHighlight
    public class ConditionalFormattingCellHighlight : ConditionalFormatting 
    Remarks

    A list of preset Styles can be found in the ConditionalFormattingStylePresets enumeration; these can be used to easily determine the Style of the accepted Cells.

    It is also possible to use the SetCustomStyle method to define a custom Style for those Cells.

    Example
    //Highlights every Cell that contains the value "4" with the default formatting style.
    ConditionalFormatting cf1 = ConditionalFormatting.CreateCellHighlight( new EqualCondition( 4 ) ).AddArea("A1", "B1"); 
    //Highlights values between 3 and 7 with a red border style.
    ConditionalFormatting cf2 = ConditionalFormatting.CreateCellHighlight( new BetweenCondition( 3, 7 ), ConditionalFormattingStylePresets.RedBorder ).AddAreas( "F1:F10" )  
    
    doc.Worksheets[ 0 ].ConditionalFormattings.Add( cf1 );
    doc.Worksheets[ 0 ].ConditionalFormattings.Add( cf2 );
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.ConditionalFormatting
          Xceed.Workbooks.NET.ConditionalFormattingCellHighlight

    Public Constructors
    Public Properties
     NameDescription
    Public PropertyGets the CellHighlightCondition used to determine if formatting will be applied.  
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded. Adds ConditionalFormatting to an area determined by two Cells. (Inherited from Xceed.Workbooks.NET.ConditionalFormatting)
    Public MethodAdds ConditionalFormatting in specific areas of the Worksheet. (Inherited from Xceed.Workbooks.NET.ConditionalFormatting)
    Public MethodRemoves all ConditionalFormattings from the Worksheet. (Inherited from Xceed.Workbooks.NET.ConditionalFormatting)
    Public MethodGets the areas using ConditionalFormatting. (Inherited from Xceed.Workbooks.NET.ConditionalFormatting)
    Public MethodOverloaded. Removes ConditionalFormatting from an area identified by Addresses. (Inherited from Xceed.Workbooks.NET.ConditionalFormatting)
    Public MethodRemoves ConditionalFormatting from specific areas of the Worksheet. (Inherited from Xceed.Workbooks.NET.ConditionalFormatting)
    Public MethodSets the CellHighlightCondition.  
    Public MethodSets a custom Style for the ConditionalFormatting. (Inherited from Xceed.Workbooks.NET.ConditionalFormatting)
    Top
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also