title: Creating Column in DataGridView in C#
body: <p>I have a problem in creating a datagrid column in c#</p>
  
  <p>here is my code.</p>
  
  <pre><code>DataGridViewColumn newCol = new DataGridViewColumn();
  newCol.HeaderText = txtHeader.Text;
  newCol.Width = Convert.ToInt16(cboWidth.Text);
  dgWorkArea.Columns.Add(newCol);
  </code></pre>
  
  <p>On my above code snippet, the error's came when trying to call the fourth (4th) line code. Here is the error.</p>
  
  <p><em>At least one of the datagridview control's columns has no cell template</em></p>
  
  <p>Can anyone help me on how can I create a simple column in datagrid.</p>