I have populated a datagridview by binding it to a dataview created from an SQL query at run time.
One of the fields is titled "File Folder" and shows a folder location on our server. I would like to display this column as a hyperlink so that users can simply click it to open explorer and open the folder.
Here is my code so far:
Dim cmd As New SqlClient.SqlCommand(SqlLine$, myConnection)
cmd.CommandTimeout = 120
da.SelectCommand = cmd
DS = New DataSet
dv = New DataView(DS.Tables("MyTable"))
DGV1.DataSource = dv
Dim links As New DataGridViewLinkColumn()
.Name = "File Folder"
.UseColumnTextForLinkValue = True
.HeaderText = "File Folder2"
.DataPropertyName = DGV1.Columns("File Folder").DataPropertyName.ToString
.ActiveLinkColor = Color.White
.LinkBehavior = LinkBehavior.SystemDefault
.LinkColor = Color.Blue
.TrackVisitedState = True
.VisitedLinkColor = Color.YellowGreen
This code creates a column on my datagridview titled "File Folder2", but the cells are blank.
What am I missing ?
Thanks for your help !!