I'm using this code for a DataGridView:
Public Class Scan
Private Sub Scan_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim col As New DataGridViewTextBoxColumn
col.DataPropertyName = "PropertyName"
col.HeaderText = "SomeText"
col.Name = "colWhateverName"
DataGridView1.Columns.Add(col)
End Sub
End Class
It automatically adds a blank column that I don't want to have in the datagridview:
How do I remove that column?
Thank you very much!
If I managed to understand your problem. You would have to change the property
RowHeadersVisible
of yourDataGridView
, for this in the Load event place:Where
dataGridView
you should change it to the name you have assigned to your DataGridView.