title: calendar column c# in datagridview
body: <p>Basically I want to show a calendar when I edit some columns in my Datagridview.</p>
  <p>Following <a href="http://msdn.microsoft.com/en-us/library/7tas5c80.aspx" rel="nofollow noreferrer">How to: Host Controls in Windows Forms DataGridView Cells</a> from MSDN I can add wanted kind of column at building.</p>
  <p>But in my case, I have to use a <em>datasource</em> provided by an Excel reader which give headings have to be connected to <em>date type</em> columns.</p>
  <pre><code>private DataGridView AddCalendars(DataGridView dtgv)
  {
    dtgv.DataSource = controller.getEmptyDataTable();     // DataTable provided by excel reader
    var l = dtgv.Columns.Count;
    string[] dateColumns = {&quot;date_received&quot;, &quot;date_of_birth&quot;};
    for (var i = 0; i &lt; l; ++i)
    {
      if ( dateColumns.Any( dtgv.Columns[i].HeaderText.Contains )
      {
        dtgv.Columns[i] = new CalendarColumn();      // this line does not work cause by readonly
      }
    }
    return dtgv;
  }
  </code></pre>
  <p>How can I apply Calendar Column control to selected columns ?</p>
  <p>Or, how can I obtain same result by building Datagridview different way ?</p>