The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

Worksheet.ClearHyperlinks(Range) Method

Removes cell hyperlinks.

Namespace: DevExpress.Spreadsheet

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

Declaration

void ClearHyperlinks(
    Range range
)
Sub ClearHyperlinks(
    range As Range
)
void ClearHyperlinks(
    Range range
)
Sub ClearHyperlinks(
    range As Range
)

Parameters

Name Type Description
range Range

A Range object specifying the cell range to clear.

Parameters

Name Type Description
range Range

A Range object specifying the cell range to clear.

Remarks

The ClearHyperlinks method removes all active hyperlinks from the specified cell range. Cell content and formatting remain unchanged. Another way to do this is to use the HyperlinkCollection.Remove or HyperlinkCollection.RemoveAt method of the Worksheet.Hyperlinks collection. Note, that these methods leave hyperlink text in a cell, but remove cell formatting.

To separately remove cell content, formatting, comments or clear a cell range completely, call the Worksheet.ClearContents, Worksheet.ClearFormats, Worksheet.ClearComments or Worksheet.Clear method, respectively. To delete entire cells from the worksheet, use the Worksheet.DeleteCells method (see the How to: Delete a Cell or Range of Cells example).

To clear cells, you can also use the range's Clear* extension methods, defined by the RangeExtensions class (RangeExtensions.Clear, RangeExtensions.ClearContents, RangeExtensions.ClearFormats, RangeExtensions.ClearHyperlinks and RangeExtensions.ClearComments). These extension methods are accessible as methods of the Range object and called by using the instance method syntax.

Examples

This example demonstrates how to clear worksheet cells.

// Remove all cell information (content, formatting, hyperlinks and comments).
worksheet.Clear(worksheet["C2:D2"]);

// Remove cell content.
worksheet.ClearContents(worksheet["C3"]);
worksheet["D3"].Value = null;

// Remove cell formatting.
worksheet.ClearFormats(worksheet["C4"]);
worksheet["D4"].Style = workbook.Styles.DefaultStyle;

// Remove hyperlinks from cells.
worksheet.ClearHyperlinks(worksheet["C5"]);

Hyperlink hyperlinkD5 = worksheet.Hyperlinks.GetHyperlinks(worksheet["D5"])[0];
worksheet.Hyperlinks.Remove(hyperlinkD5);

// Remove comments from cells.
worksheet.ClearComments(worksheet["C6"]);
See Also