title: Create datacolumns from datagridview columns
body: <p>I have a datagridview with columns that I have created at design time. </p>
  
  <p>I now want to create a datatable with the same columns as in the gridview programatically.</p>
  
  <p>I tried the following code.</p>
  
  <pre><code>Dim dataTable As New DataTable
  For Each col As DataGridViewColumn In dgDocEntries.Columns
     dataTable.Columns.Add(col)
  Next
  </code></pre>
  
  <p>This throws a compile error: value of DataGridViewColumn cannot be converted to DataColumn. Obviously I tried casting the types but it didn't work.</p>
  
  <p>I can't use the datasource property to clone/copy either because I am setting the rows manually.</p>