GridHyperlinkColumn fails to navigate in .NET CORE

Hi,

I have a SFDataGrid with a GridHyperlinkColumn.
When I click the link I get an Win32Exception "File not found".

I debugged it and found that it looks like this
https://stackoverflow.com/questions/7693429/process-start-to-open-an-url-getting-an-exception
problem.

So how can I make it use "start GIVENURL" or something like this.
I usw MVVM so "code behind solution" (cell event handling) is not what I want.



2 Replies 1 reply marked as answer

MA ManniAT May 28, 2021 10:54 AM UTC

I was able to create a workaround by subclassing the SFDataGrid like this:

public class MyGrid : SfDataGrid {
public MyGrid() {
this.CurrentCellRequestNavigate += MyGrid_CurrentCellRequestNavigate;
}

private void MyGrid_CurrentCellRequestNavigate(object sender, CurrentCellRequestNavigateEventArgs e) {
if(e.NavigateText?.StartsWith("http")??false) {
ProcessStartInfo sI = new ProcessStartInfo(e.NavigateText) { UseShellExecute = true };
try { Process.Start(sI); }
catch { } //just ignore if a link doesn't work
e.Handled = true;
}
}
}

Anyhow I think this should work "out of the box".

Marked as answer

MA Mohanram Anbukkarasu Syncfusion Team May 31, 2021 12:12 PM UTC

Hi ManniAT, 
 
Thanks for contacting Syncfusion support.  
 
We are glad to know that you have resolved the problem in your end. Please let us know if you require any other assistance from us. We are happy to help you.  
 
Regards, 
Mohanram A. 


Loader.
Up arrow icon