I came up with following code that adds number of columns ... Try this DataGridView1.Columns(i).Name ...
stackoverflow.com