My Application is a windows form application in VB.
I have DataGridView in my Application. The seventh column is defined as DataGridViewLinkColumn when i designed the DataGridView. My Application reads the link from a table and Grid properly displays it.
I don't want my user to see the link, i want them to see a sentence like "Click here to visit" but i couldn't manage to do.
Second, when i click the link nothing happens. I know that i have to handle this in CellContentClick event but i don't know how to call the default browser directed to the link.
Thanks in advance.
There is no direct property in
DataGridViewLinkColumnwhich separates the display text and url.To achieve your goal, you need to handle two events
CellFormattingandCellContentClick. Subscribe to these events.In
CellFormattingevent handler, change the formatted value toClick here to visit. The flagFormattingAppliedmust be setTrueas this prevents further formatting of the value.To open the link in the default browser, use the
Processclass and pass the url as argument to theStartmethod. Put the code in theCellContentClickevent handler.