I have a datagrid, and I need to get the name of it by a click event (of the headers). I have been playing around with this, but no luck. I get a null ref:
VB.NET:
Private Sub dataGrid_MouseUp(ByVal o As Object, ByVal mea As MouseEventArgs) Handles dataGrid.mousedoubleclick
Dim hitTest As DataGrid.HitTestInfo
' Get the name of the column that was clicked.
messagebox.show(dataTable.Columns(hitTest.Column).ColumnName)
End Sub
Last edited by a moderator: