VGridOptionsBehavior.HyperlinkClickMode Property
Gets or sets whether and how hyperlinks in row captions and record headers are activated.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
Declaration
[DefaultValue(HyperlinkClickMode.Default)]
[XtraSerializableProperty]
public virtual HyperlinkClickMode HyperlinkClickMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
HyperlinkClickMode | Default | A value that specifies whether and how hyperlinks in row captions and record headers are activated. |
Available values:
Name | Description |
---|---|
Default | The same as the None option. |
CtrlClick | A hyperlink is activated on a mouse click when the CTRL key is pressed down. |
Click | A hyperlink is activated on a mouse click. |
None | Do not activate a hyperlink on a mouse pointer hover or click event. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to HyperlinkClickMode |
---|---|
VGridControlBase |
|
Remarks
You can use HTML tags to insert hyperlinks in row captions and record headers (see OptionsView.AllowHtmlText for information on how to enable these tags).
The default behavior is to display hyperlinks, but do not activate them on mouse events.
Set the control’s HyperlinkClickMode property to one of the following values:
- Click value — A hyperlink is activated on a mouse click.
- CtrlClick value — A hyperlink is activated on a mouse click when the CTRL key is pressed down.
Hyperlinks are never activated if the HyperlinkClickMode property is set to Default or None.
Handle the VGridControlBase.HyperlinkClick event to perform actions on hyperlink activation.
Example
In the following example, a Vertical Grid’s record headers contain hyperlinks that display employees’ e-mails. The VGridOptionsBehavior.HyperlinkClickMode
property is set to CtrlClick to allow users to activate hyperlinks on a mouse click when the CTRL key is pressed down. The VGridControlBase.HyperlinkClick event handler starts a process that opens a clicked hyperlink.
private void Form1_Load(object sender, EventArgs e) {
BindingList<Message> list = new BindingList<Message>();
list.Add(new Message() { Date = DateTime.Now, Email = "jheart@dx-email.com", From = "John Heart", PlainText = "Hello All Please remember that I’ve rescheduled...", Subject = "DevAV Annual Performance Review" });
list.Add(new Message() { Date = DateTime.Now, Email = "violetb@dx-email.com", From = "Violet Bailey", PlainText = "Good Day Morgan I’ve been asked by the sales team...", Subject = "Artwork for packaging" });
vGridControl1.DataSource = list;
vGridControl1.OptionsView.ShowRecordHeaders = true;
vGridControl1.OptionsView.AllowHtmlText = true;
vGridControl1.RecordHeaderFormat = "<b>{From}</b><br><a href=mailto:{Email}>{Email}</a>";
vGridControl1.Appearance.RecordHeader.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
vGridControl1.RecordWidth = 150;
vGridControl1.OptionsBehavior.HyperlinkClickMode = DevExpress.Utils.Drawing.HyperlinkClickMode.CtrlClick;
vGridControl1.HyperlinkClick += VGridControl1_HyperlinkClick;
}
private void VGridControl1_HyperlinkClick(object sender, DevExpress.XtraVerticalGrid.Events.HyperlinkClickEventArgs e) {
if (e.Link.StartsWith("mailto:"))
System.Diagnostics.Process.Start(e.Link);
}
public class Message {
public DateTime Date { get; set; }
public string From { get; set; }
public string Email { get; set; }
public string Subject { get; set; }
public string PlainText { get; set; }
}