转换DatagridViewLinkColumn中的DataGridViewColumn

时间:2015-03-11 19:21:59

标签: vb.net datagridview dynamic-columns datagridviewlinkcolumn

我有一个显示3列的DataGridView,但我想在链接文本中转换其中一列的值。

我将DataGridView填充如下:

DataGridViewSearchReport.DataSource = queryResDT

queryResDT是来自SQL查询的DataTable

1 个答案:

答案 0 :(得分:0)

 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