Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCustomSpreadSheet.OnHyperlinkExecute Event

In This Article

Allows you to perform custom actions on executing a hyperlink.

#Declaration

Delphi
property OnHyperlinkExecute: TdxSpreadSheetHyperlinkExecuteEvent read; write;

#Remarks

This event occurs every time the control is about to:

  • Navigate to display the cell range to which the executed hyperlink is referring;

  • Open an external hyperlink target in the default web browser or mail client application, depending on the URI scheme of the executed hyperlink’s reference.

Handle the OnHyperlinkExecute event to override or complement the default activation routines for all or only specifc hyperlinks in a spreadsheet document that you can identify by their hints, anchor texts, references, and indexes within a worksheet’s hyperlink collection. For instance, you can identify a hyperlink as external and forbid end-users to open it, or invoke a notification or confirmation message box on clicking the hyperlink. The following code example implements an OnHyperlinkExecute event handler that allows you to open only internal hyperlinks in a spreadsheet:

procedure TMyForm.dxSpreadSheet1HyperlinkExecute(Sender: TdxCustomSpreadSheet; AHyperlink: TdxSpreadSheetHyperlink; var AHandled: Boolean);
begin
  if AHyperlink.ValueType <> hvtReference then  // If the activated hyperlink is not internal...
    AHandled := True;  // Prevents hyperlink execution
end;

Refer to the TdxSpreadSheetHyperlinkExecuteEvent procedural type description for detailed information on all parameters accessible within an OnHyperlinkExecute event handler.

Note

A hyperlink’s Execute procedure call raises the OnHyperlinkExecute event only if the hyperlink has a specified reference or address.

See Also