我有一个datatable显示在DataGridView.
我希望用户在 中选择一个值,datagridview并将该值用作过滤器以在 中查找另一个值datatable。
所以像:
SELECT col2 from DataTable2 where col1=
(value in selected cell of the DataGridView)
编辑
好的,我添加了一些额外的信息,因为我不确定我问的是正确的问题:
我在下面有一个工具提示datagridview:
Sub dataGridView1_CellFormatting(ByVal sender As Object, _
ByVal e As DataGridViewCellFormattingEventArgs) _
Handles DataGridView1.CellFormatting
If e.ColumnIndex = Me.DataGridView1.Columns("Last Stop").Index _
AndAlso (e.Value IsNot Nothing) Then
With Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex)
.ToolTipText = '(THIS IS WHERE I'M STUCK)
End With
End If
End Sub
我在上面停留的一点是我想在其中使用值Last Stop以便e.Value在我的 DataTable 中查找名称 -
ToolTipSN.Tables("DT_ToolTip")