title: C# - How can i get header row from datatable and arrange it vertically down a column?
body: <p>How can i turn this datagridview from datatable
  <a href="https://i.stack.imgur.com/q7IEm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q7IEm.png" alt="enter image description here"></a></p>
  
  <p>into this
  <a href="https://i.stack.imgur.com/0dgEP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0dgEP.png" alt="enter image description here"></a></p>
  
  <p>Here is my code now. Any suggestion, comments, or sample code are highly appreciated. Thank you.</p>
  
  <pre><code>            DataSet result = excelReader.AsDataSet();
  
              excelReader.Close();
  
              if (result != null)
              {
                  DataTable dataTable = result.Tables[0];
                  List&lt;string&gt; headers = new List&lt;string&gt;();
                  foreach (DataColumn col in dataTable.Columns)
                  {
                      headers.Add(col.ColumnName);
                  }
                  dataGridView1.DataSource = dataTable;
              }
  </code></pre>