Esempio n. 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();
     }
 }
Esempio n. 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);
            }
        }