0

I'm having problems checking checkboxes of multiple rows at one time using the shift key and FullRowSelect. The checkboxes are in the first column (0). It only checks the box in the row I click on. Any tips or advice is appreciated. Thanks in advance.

Here's what I have currently.

       private void dgv_On_CellClick(object sender, DataGridViewCellEventArgs e)
    {
        dgv_Off.ClearSelection();
        int colindex = dgv_On.CurrentCell.ColumnIndex;
        foreach (DataGridViewRow dgvOn in dgv_On.SelectedRows)
        {
            if (colindex == 0)
            {
                if (dgvOn.Selected)
                    dgvOn.Cells[0].Value = true;
                else
                {
                    dgvOn.Cells[0].Value = false;
                }
            }
        }
        contextMenuOff.Enabled = false;
        contextMenuOn.Enabled = true;
    }
J33C316
  • 3
  • 3

0 Answers0