예제 #1
0
 private void BranchGrid_CurrentCellDirtyStateChanged(object sender, EventArgs e)
 {
     // Push grid checkbox changes immediately into the underlying data table.
     if (BranchGrid.CurrentCell is DataGridViewCheckBoxCell)
     {
         BranchGrid.EndEdit();
         ((BindingSource)BranchGrid.DataSource).EndEdit();
     }
 }
예제 #2
0
        private void SetBranchesPushCheckboxesState(Func <DataGridViewRow, bool> willPush)
        {
            // Necessary to end the edit mode of the Cell.
            BranchGrid.EndEdit();

            foreach (DataGridViewRow row in BranchGrid.Rows)
            {
                var pushCheckBox = row.Cells[PushColumn.Name] as DataGridViewCheckBoxCell;
                if (pushCheckBox == null || !pushCheckBox.Visible)
                {
                    continue;
                }

                pushCheckBox.Value = willPush(row);
            }
        }