private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)

        {

            try

            {

                int row = e.RowIndex;

                int col = e.ColumnIndex;

                if (dgv.CurrentCell is System.Windows.Forms.DataGridViewCheckBoxCell)

                {

 

                    DataGridViewCell cell = dgv.CurrentCell;

 

                    DataGridViewCheckBoxCell checkCell =

                        (DataGridViewCheckBoxCell)dgv.Rows[row].Cells[col];

 

                    //------------------------------------------------------------------

                    //

                    //------------------------------------------------------------------

                    bool newBool = (bool) checkCell.EditingCellFormattedValue;

                    bool originalBool = !newBool;

                    string originalValue = originalBool.ToString();

                    string newValue = newBool.ToString();

                }

 

            }

            catch (Exception ex)

            {

            }

        }

 

    Private Sub dgv_CurrentCellDirtyStateChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dgv.CurrentCellDirtyStateChanged

        '--------------------------------------------------------

        'when a user checks/unchecks a checkbox

        'perform "commitEdit" so that "CellValueChanged" event gets fired

        '--------------------------------------------------------

        If dgv.IsCurrentCellDirty Then

            dgv.CommitEdit(DataGridViewDataErrorContexts.Commit)

        End If

 

    End Sub

 

    Private Sub dgv_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv.CellValueChanged

 

        '--------------------------------------------------------

        'when a user checks/unchecks a checkbox

        'be sure to check/uncheck other rows with same session, barcode and assay (but different seq)

        '--------------------------------------------------------

        Dim checked As Boolean = Boolean.Parse(dgv.CurrentRow.Cells(gCol.PlateIsLabeled).Value.ToString) = True

        Dim targetSessionName As String = dgv.CurrentRow.Cells(gCol.SessionName).Value.ToString

        Dim targetPlateBarcode As String = dgv.CurrentRow.Cells(gCol.PlateBarcode).Value.ToString

        Dim targetAssayName As String = dgv.CurrentRow.Cells(gCol.AssayName).Value.ToString

        For Each irow As DataGridViewRow In dgv.Rows

            If irow.Index <> dgv.CurrentRow.Index Then

                Dim PlateBarcode As String = irow.Cells(gCol.PlateBarcode).Value.ToString

                Dim AssayName As String = irow.Cells(gCol.AssayName).Value.ToString

                Dim SessionName As String = irow.Cells(gCol.SessionName).Value.ToString

                If PlateBarcode = targetPlateBarcode _

                And AssayName = targetAssayName _

                And SessionName = targetSessionName _

                Then

                    irow.Cells(gCol.PlateIsLabeled).Value = checked

                End If

            End If

        Next

 

    End Sub

Capture DataGridView CheckBox Checked event on a WinForm