Private Sub DataGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseUp
Dim pt As New System.Drawing.Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo
hti = DataGrid1.HitTest(e.X, e.Y)
If (hti.Type = DataGrid.HitTestType.Cell) Then
MessageBox.Show(DataGrid1(hti.Row, hti.Column).ToString())
ElseIf hti.Type = DataGrid.HitTestType.ColumnHeader Then
MessageBox.Show((DataGrid1.DataSource).Table.Columns(hti.Column).ToString())
End If
End Sub