Skip to main content
Row

RangeExtensions.ClearComments(CellRange) Method

Removes cell comments.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public static void ClearComments(
    this CellRange range
)

Parameters

Name Type Description
range CellRange

A CellRange object specifying the cell range to clear.

Remarks

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

Another way to delete comments from cells is to use the CommentCollection.Remove or CommentCollection.RemoveAt method of the Worksheet.Comments collection.

To separately remove cell content, formatting, hyperlinks or clear a cell range completely, call the RangeExtensions.ClearContents, RangeExtensions.ClearFormats, RangeExtensions.ClearHyperlinks 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