title: DataGridView checkbox not updating
body: <p>can anyone please tell me why my checkbox does not get checked?
  I'm using Windows.Forms and the Grid is set to ReadOnly=False here's the code i'm using:</p>
  
  <pre><code>private void populateView() 
      {
          try
          {
              DataTable theTable = [query execution]
              DataView dv = theTable.DefaultView;
              dataGrid1.DataSource = dv;
              DataGridViewCheckBoxColumn[] checkBoxes = new DataGridViewCheckBoxColumn[20];
              int pos = 0;
  
              foreach (DataGridViewColumn column in RouteRampView.Columns)
              {
                  if (column.Name.Equals("A"))
                  {
                      column.Visible = false;
                  }
                  if (column.Name.Equals("B"))
                  {
                      column.Visible = true;
                      column.ReadOnly = true;
                  }
                  if (column.Name.Equals("C"))
                  {
                      column.Visible = true;
                      column.ReadOnly = true;
                  }
                  if ( column.Name.Contains("D") )
                  {
                      var doWork = new DataGridViewCheckBoxColumn();
                      doWork.Name = column.Name +"BOX";
                      doWork.HeaderText = column.Name;
                      doWork.FalseValue = "0";
                      doWork.TrueValue = "1";
                      column.Visible = true;
                      checkBoxes[pos] = doWork;
                      pos++;
                  }
              }
              foreach (DataGridViewCheckBoxColumn column in checkBoxes)
              {
                  if (column != null)
                  {
                      dataGrid1.Columns.Add(column);
                  }
  
              }
  
          }
          catch (Exception e)
          {
              log.Error("Error occured when populating grid", e);
          }
      }
  </code></pre>
  
  <p>and after the view is created i call:</p>
  
  <pre><code>private void fillValues()
          {
              foreach (DataGridViewRow row in dataGrid1.Rows)
              {
                  DataGridViewCheckBoxCell col1 = (DataGridViewCheckBoxCell)row.Cells["D1BOX"];
                  col1.Selected = ((Decimal)row.Cells["D1"].Value &gt; 0);
                  col1.ThreeState = ((Decimal)row.Cells["D1"].Value &gt; 0);
                  col1.Value = ((Decimal)row.Cells["D1"].Value &gt; 0 ? col1.TrueValue : col1.FalseValue );
  
  
                  DataGridViewCheckBoxCell col2 = (DataGridViewCheckBoxCell)row.Cells["D2BOX"];
                  col2.Selected = ((Decimal)row.Cells["D2"].Value &gt; 0);
                  col2.ThreeState = ((Decimal)row.Cells["D2"].Value &gt; 0);
                  col2.Value = ((Decimal)row.Cells["D2"].Value &gt; 0 ? col1.TrueValue : col1.FalseValue);
  
                  DataGridViewCheckBoxCell col3 = (DataGridViewCheckBoxCell)row.Cells["D3BOX"];
                  col3.Selected = ((Decimal)row.Cells["D3"].Value &gt; 0);
                  col3.ThreeState = ((Decimal)row.Cells["D3"].Value &gt; 0);
                  col3.Value = ((Decimal)row.Cells["D3"].Value &gt; 0 ? col1.TrueValue : col1.FalseValue);
  
                  DataGridViewCheckBoxCell col4 = (DataGridViewCheckBoxCell)row.Cells["D4BOX"];
                  col4.Selected = ((Decimal)row.Cells["D4"].Value &gt; 0);
                  col4.ThreeState = ((Decimal)row.Cells["D4"].Value &gt; 0);
                  col4.Value = ((Decimal)row.Cells["D4"].Value &gt; 0 ? col1.TrueValue : col1.FalseValue);
  
                  DataGridViewCheckBoxCell col5 = (DataGridViewCheckBoxCell)row.Cells["D5BOX"];
                  col5.Selected = ((Decimal)row.Cells["D5"].Value &gt; 0);
                  col5.ThreeState = ((Decimal)row.Cells["D5"].Value &gt; 0);
                  col5.Value = ((Decimal)row.Cells["D5"].Value &gt; 0 ? col1.TrueValue : col1.               
  
              }
  </code></pre>
  
  <p>When the value is changed the event handler then calls</p>
  
  <pre><code>        RouteRampView.EndEdit();
          RouteRampView.Refresh();
  </code></pre>
  
  <p>When debugging i've seen that the Value parameter of the checkbox is assigned the correct value but for some reason the box is never checked.</p>