I have a databound radgridview.
I have added a GridViewHyperLinkColumn as seen below to the grid after the databound.
GridViewHyperlinkColumn col = new GridViewHyperlinkColumn();
col.Width = 200;col.FieldName = "Title";
col.HeaderText = "Title";
col.Name = "Title";
col.HyperlinkOpenAction = HyperlinkOpenAction.SingleClick;
gvResults.Columns.Insert(5, col);
On the CellFormatting I have added the follow to show a short text but a different Hyperlink
private void gvResults_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e){
if(e.Column.Name == "Title")
{
string LinkUrl = e.Row.Cells["Path"].Value.ToString();
string LinkTitle = e.CellElement.Text;
e.CellElement.Text = $"<html> <a href=\"{LinkUrl}\" >{ LinkTitle}";
e.CellElement.DisableHTMLRendering = false;
e.CellElement.ToolTipText = LinkUrl;
}
}
I have registered
gvResults.HyperlinkOpening += gvResults_HyperlinkOpening;
And perform some items during this that include Opening the link using the ProcessStart.
My issue is the link opens in a browser before the gvResults_Hyperlink event is called.
I DO NOT want the LINK to open automatically, I want the gvResults_HyperLinkOpening event to do the open.
Any suggestions?