Skip to main content
All docs
V25.1
  • Row

    RangeExtensions.ClearFormats(CellRange) Method

    Removes cell formatting.

    Namespace: DevExpress.Spreadsheet

    Assembly: DevExpress.Spreadsheet.v25.1.Core.dll

    NuGet Package: DevExpress.Spreadsheet.Core

    Declaration

    public static void ClearFormats(
        this CellRange range
    )

    Parameters

    Name Type Description
    range CellRange

    A CellRange object specifying the cell range to clear.

    Remarks

    The ClearFormats method removes cell formatting only. Cell content, active hyperlinks and comments remain unchanged. This is an extension method of the CellRange object that is called by using the instance method syntax.

    Another way to delete formatting from cells is to apply the Normal style to a cell range via the CellRange.Style property.

    To separately remove cell content, hyperlinks, comments or clear a cell range completely, call the RangeExtensions.ClearContents, RangeExtensions.ClearHyperlinks, RangeExtensions.ClearComments or RangeExtensions.Clear method, respectively. To delete entire cells from the worksheet, use the RangeExtensions.Delete method.

    To clear cells, you can also use the Clear* methods of the Worksheet object (see the How to: Clear Cells of Content, Formatting, Hyperlinks and Comments example).

    See Also