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
DataGridViewLinkColumn
which separates the display text and url.To achieve your goal, you need to handle two events
CellFormatting
andCellContentClick
. Subscribe to these events.In
CellFormatting
event handler, change the formatted value toClick here to visit
. The flagFormattingApplied
must be setTrue
as this prevents further formatting of the value.To open the link in the default browser, use the
Process
class and pass the url as argument to theStart
method. Put the code in theCellContentClick
event handler.