22 August 2012

Default checked a checkbox column at runtime using C#.Net

The Following code will display checked a Checkbox at runtime in the Datagridview using C#.net
foreach (DataGridViewRow dr in dataGridView1.Rows)
          {

              if (dr.Cells[0].Value == null) //Cells[0] Because in cell 0th cell we have added checkbox
              {

                  dr.Cells[0].Value = true;

              }

No comments: