Click here to Skip to main content
16,010,022 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
other checkboxs is not getting selected

What I have tried:

C#
private void checkboxHeader_CheckedChanged(object sender, EventArgs e)
        {
            for (int i = 0; i < dataGridView1.RowCount; i++)
            {
                dataGridView1[0, i].Value = ((CheckBox)dataGridView1.Controls.Find("checkboxHeader", true)[0]).Checked;

            }
            for (int j = 0; j <= dataGridView1.RowCount - 1; j++)
            {
                dataGridView1[j, 0].Value = ((CheckBox)sender).Checked;
            }
            dataGridView1.EndEdit();
            
          
        }
Posted
Updated 7-Mar-16 21:23pm
v3

1 solution

Try this:

C#
DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell(dataGridView1.Rows[j].Cells[0]);
cell.Value = cell.TrueValue;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900