Adding a column to a DataGridView

TKap

Member
Joined
Nov 5, 2012
Messages
9
Programming Experience
Beginner
The following is my code...

Dim btn As New DataGridViewButtonColumn()


DataGridView1.Columns.Insert(3, btn)


I am wanting to add the new column at columnIndex 3 but on executing this code the new column gets added at columnIndex 0. Why is this so?

P.S I stored the columnIndex in a variable and checked and at the front end also the column gets added as the first column of the dataGrid.
 
Back
Top