I have a datagridview on a windows form and I need to select all the rows in the gridview when the user clicks a check box on the form.
I put the code in the the Form_Load event handler:
Code:
if (ckSelAll.Checked == true)
             {
                 foreach (DataGridViewRow dgrv in MyGridView.Rows)
                 {
                     dgrv.Selected = true;
                                      }
             }
when I load the form and check the checkbox, nothing happens.

Please help. Thanks.