title: DataError on DataGridViewComboBoxColumn bound to a DataTable
body: <p>I've found several topics with a similar issue but the contents seemed slightly different and I have not been able to solve my problem as a result.</p>
  
  <p>In my application I have DataTable that contains 4 columns:</p>
  
  <ul>
  <li>UInt16</li>
  <li>UInt64</li>
  <li>UInt64</li>
  <li>A self defined enumeration type consisting of 2 values.</li>
  </ul>
  
  <p>In order to display the values of this DataTable I created a DataGridView and set this table as the datasource. So far so good. I wanted the enumeration field column to contain comboboxes instead and ran into the DataGridViewComboBoxColumn type. I had some issues getting it to work but eventualy ended up using the following approach:</p>
  
  <pre><code>// Create the 4 datarows
  
  // Add the datarows to the data table
  
  // Set the data table as the data source for the data grid view
  
  // Remove the column that represents the enumeration
  
  // Add a DataGridViewComboBoxColumn to the DataGridView as replacement
  </code></pre>
  
  <p>I have created the DataGridViewComboBoxColumn as follows:</p>
  
  <pre><code>DataGridViewComboBoxColumn cb = new DataGridViewComboBoxColumn();
  cb.HeaderText   = "My header text";
  cb.ValueType    = typeof(MyEnumType);
  cb.DataSource   = Enum.GetValues(typeof(MyEnumType));
  cb.FlatStyle    = FlatStyle.System;
  cb.Name         = "Name"; //Same name as the DataColumn and the now deleted DataGridViewColumn
  cb.DataPropertyName = "Name"; //Same name as the DataColumn and the now deleted DataGridViewColumn
  cb.DisplayStyle     = DataGridViewComboBoxDisplayStyle.Nothing;
  
  dataGridView.Columns.Add(cb);
  </code></pre>
  
  <p>Once my application starts I read in data from a text file that get placed into a structure with fields of the 4 datatypes mentioned above. I then add these fields to the DataTable as follows:</p>
  
  <pre><code>DataRow row = dataTable.NewRow();
  row["Name of the UInt16 column"]    = mystruct.theUInt16;
  row["Name of the UInt64 column"]    = mystruct.theUInt64;
  row["Name of the UInt64 column"]    = mystruct.theUInt64_2;
  row["Name of the enum column"]      = mystruct.theEnumValue;               
  dataTable.Rows.Add(row);
  </code></pre>
  
  <p>on startup the DataError event gets called repeatedly. The contents of the cells do get filled properly however. (I see this after clicking away the error a couple of times) Disabling the DataError event (assigning an empty handler for example) is something I prefer to not do.</p>
  
  <p>I think there is some sort of type mismatch somehow. (maybe the enum type and a string for display?) This is however only a guess. The dataTable column and the datagridview column both have the type set to the enumeration.</p>
  
  <p>I hope someone can point me in the right direction. </p>
  
  <p>Thanks in advance!</p>