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:
when I load the form and check the checkbox, nothing happens.Code:if (ckSelAll.Checked == true) { foreach (DataGridViewRow dgrv in MyGridView.Rows) { dgrv.Selected = true; } }
Please help. Thanks.




Reply With Quote