I have a datagridview in a winform for my .net application. Using access 07 for db. I am trying to retrieve the name of the selected column but I have found nothing available to assist me. This is what I do on the ColumnheaderMouseClick event :
With this this I get this exception
thanks for all the help.
VB.NET:
Dim criteria As Integer
criteria = CInt(AllServicesDataGridView.SelectedColumns.ToString)
Dim xx As String
xx = AllServicesDataGridView.Columns(criteria).HeaderText
TextBox1.Text = xx
With this this I get this exception
conversion from string "System.Windows.forms.datagridview to type integer is not valid
thanks for all the help.