vb.net Code:
  1. For Each col As DataGridViewColumn In DataGridView1.Columns
  2.     Debug.WriteLine(col.Name)
  3. Next