title: Unable to set DataGridViewCheckBoxCell.Value from within Form constructor
body: <p>Something quite strange. I have a DataGridView with an unbound CheckBox column. When the selected item of a ComboBox changes the DataGridView has it's DataSource updated (according to what is selected in the ComboBox, there is no binding here, just a conditional statement). After the DataSource is updated I iterate through a collection and set the values of the CheckBox column accordingly. This works fine. However, when I decided to try to set the SelectedItem of the ComboBox in the constructor so that there is a value in the ComboBox when the Form loads, the same method fails to update the state of the CheckBox cells, even though stepping through in the debugger shows that the values have been set to true.</p>
  
  <pre><code>public LocksForm()
      {
          InitializeComponent();
  
          AddDataGridColumns();
          GetLookupData();
  
          cboLockType.SelectedIndexChanged += cboLockType_SelectedIndexChanged;
  
          //Setting this fires the event but the checkboxes in the grid remain unchecked
          cboLockType.SelectedItem = cboLockType.Items[0];
  
      }
  
  private void cboLockType_SelectedIndexChanged(object sender, EventArgs e)
      {
          //Bind the data to the grid etc.
  
          UpdateLocks()
      }
  
  // This works but not when fired from the Form constructor, only when user selects a value from ComboBox at Runtime
  private void UpdateLocks()
      {
          if (_lockedIDs != null &amp;&amp; _lockedIDs.Any())
          {
              for (int j = 0; j &lt; dgLocks.RowCount; j++)
              {
                  if (_lockedIDs.Contains((Guid)dgLocks[0, j].Value))
                  {
                      dgLocks[1, j].Value = true;
                  }
  
              }
  
          }
      }
  </code></pre>