Elian
Elian

Reputation: 60

Convert a DataGridViewColumn in DatagridViewLinkColumn

I have a DataGridView that shows 3 columns, but I want to convert the values of one of these columns in link texts.

I populate my DataGridView as follow:

DataGridViewSearchReport.DataSource = queryResDT

queryResDT is a DataTable from a SQL query

Upvotes: 0

Views: 1030

Answers (1)

Elian
Elian

Reputation: 60

 Private Sub DataGridViewSearchReport_DataBindingComplete(sender As Object, e As DataGridViewBindingCompleteEventArgs) Handles DataGridViewSearchReport.DataBindingComplete
    For Each row As DataGridViewRow In DataGridViewSearchReport.Rows
        If Not IsNothing(row.Cells("Report Name")) Then
            row.Cells("Report Name") = New DataGridViewLinkCell
        End If
    Next
End Sub

Upvotes: 0

Related Questions