Skip to main content
All docs
V24.1

ItemsView.HyperlinkClick Event

Occurs when a user clicks a URL in an HTML template and allows you to manually handle the event.

Namespace: DevExpress.XtraGrid.Views.Items

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

[DXCategory("Events")]
public event ColumnViewHyperlinkClickEventHandler HyperlinkClick

Event Data

The HyperlinkClick event's data class is ColumnViewHyperlinkClickEventArgs. The following properties provide information specific to this event:

Property Description
Bubbles Returns whether this element can pass an event up along the tree, to its parent HTML elements. You can enable the CancelBubble property to stop an event at this control level. See any “HtmlElementMouse~” event description for more details on bubbling (for example, WinExplorerView.HtmlElementMouseClick). Inherited from DxHtmlElementEventArgs.
CancelBubble Specifies whether this element should pass an event to its parent elements. See any “HtmlElementMouse~” event description for more information about bubbling (for example, WinExplorerView.HtmlElementMouseClick). Inherited from DxHtmlElementEventArgs.
CurrentTarget Inherited from DxHtmlElementEventArgs.
Element Inherited from DxHtmlElementEventArgs.
ElementId Returns the unique identifier of an HTML element. Element IDs are set in HTML markup (the “id” property). See any “HtmlElementMouse~” event description for more information (for example, WinExplorerView.HtmlElementMouseClick). Inherited from DxHtmlElementEventArgs.
NodeName Inherited from DxHtmlElementEventArgs.
RootElement Inherited from DxHtmlElementEventArgs.
RowHandle Gets an item’s handle.
SuppressOwnerEvent Specifies whether a control whose HTML element triggered this event should raise its own related event. See any “HtmlElementMouse~” event description for more information (for example, WinExplorerView.HtmlElementMouseClick). Inherited from DxHtmlElementEventArgs.
TagName Inherited from DxHtmlElementEventArgs.
Target Inherited from DxHtmlElementEventArgs.

The event data class exposes the following methods:

Method
HasClassName(String, Boolean)
HasId(String, Boolean)
HasTag(String, Boolean)

Remarks

Handle the HyperlinkClick event to manually process user clicks on an <a> tag in an HTML template. Use the e.Href property to obtain the <a> tag’s href attribute. The e.RowHandle property identifies an item whose link was clicked.

Set the e.Handled property to true to cancel the default action.

using DevExpress.XtraGrid.Views.Base;

private void itemsView1_HyperlinkClick(object sender, ColumnViewHyperlinkClickEventArgs e) {
    e.Handled = !e.Href.Contains("devexpress.com");
}
See Also