private void EditAll()
        {
            RibbonBase rb    = (RibbonBase)localMenu.DataContext;
            var        iBase = UtilDisplay.GetMenuCommandByName(rb, "EditAll");

            if (iBase == null)
            {
                return;
            }

            if (dgDebtorOffers.Readonly)
            {
                dgDebtorOffers.MakeEditable();
                UserFieldControl.MakeEditable(dgDebtorOffers);
                iBase.Caption = Uniconta.ClientTools.Localization.lookup("LeaveEditAll");
                ribbonControl.EnableButtons(new string[] { "AddLine", "CopyRow", "DeleteRow", "SaveGrid" });
                editAllChecked = false;
            }
            else
            {
                if (IsDataChaged)
                {
                    string            message            = Uniconta.ClientTools.Localization.lookup("SaveChangesPrompt");
                    CWConfirmationBox confirmationDialog = new CWConfirmationBox(message);
                    confirmationDialog.Closing += async delegate
                    {
                        if (confirmationDialog.DialogResult == null)
                        {
                            return;
                        }

                        switch (confirmationDialog.ConfirmationResult)
                        {
                        case CWConfirmationBox.ConfirmationResultEnum.Yes:
                            await dgDebtorOffers.SaveData();

                            break;

                        case CWConfirmationBox.ConfirmationResultEnum.No:
                            break;
                        }
                        editAllChecked          = true;
                        dgDebtorOffers.Readonly = true;
                        dgDebtorOffers.tableView.CloseEditor();
                        iBase.Caption = Uniconta.ClientTools.Localization.lookup("EditAll");
                        ribbonControl.DisableButtons(new string[] { "AddLine", "CopyRow", "DeleteRow", "SaveGrid" });
                    };
                    confirmationDialog.Show();
                }
                else
                {
                    dgDebtorOffers.Readonly = true;
                    dgDebtorOffers.tableView.CloseEditor();
                    iBase.Caption = Uniconta.ClientTools.Localization.lookup("EditAll");
                    ribbonControl.DisableButtons(new string[] { "AddLine", "CopyRow", "DeleteRow", "SaveGrid" });
                }
            }
        }
        private void EditAll()
        {
            RibbonBase rb    = (RibbonBase)localMenu.DataContext;
            var        ibase = UtilDisplay.GetMenuCommandByName(rb, "EditAll");

            if (ibase == null)
            {
                return;
            }
            if (dgDebtorTransOpen.Readonly)
            {
                api.AllowBackgroundCrud = false;
                dgDebtorTransOpen.MakeEditable();
                UserFieldControl.MakeEditable(dgDebtorTransOpen);
                ibase.Caption = Uniconta.ClientTools.Localization.lookup("LeaveEditAll");
                ribbonControl.EnableButtons("SaveGrid");
                copyRowIsEnabled = true;
                editAllChecked   = false;
#if !SILVERLIGHT
                OnHold.ShowCheckBoxInHeader = Paid.ShowCheckBoxInHeader = true;
#endif
            }
            else
            {
#if !SILVERLIGHT
                OnHold.ShowCheckBoxInHeader = Paid.ShowCheckBoxInHeader = false;
#endif
                if (IsDataChaged)
                {
                    string            message            = Uniconta.ClientTools.Localization.lookup("SaveChangesPrompt");
                    CWConfirmationBox confirmationDialog = new CWConfirmationBox(message);
                    confirmationDialog.Closing += async delegate
                    {
                        if (confirmationDialog.DialogResult == null)
                        {
                            return;
                        }
                        switch (confirmationDialog.ConfirmationResult)
                        {
                        case CWConfirmationBox.ConfirmationResultEnum.Yes:
                            var err = await dgDebtorTransOpen.SaveData();

                            if (err != 0)
                            {
                                api.AllowBackgroundCrud = true;
                                return;
                            }
                            break;

                        case CWConfirmationBox.ConfirmationResultEnum.No:
                            break;
                        }
                        editAllChecked             = true;
                        dgDebtorTransOpen.Readonly = true;
                        dgDebtorTransOpen.tableView.CloseEditor();
                        ibase.Caption = Uniconta.ClientTools.Localization.lookup("EditAll");
                        ribbonControl.DisableButtons("SaveGrid");
                        copyRowIsEnabled = false;
                    };
                    confirmationDialog.Show();
                }
                else
                {
                    dgDebtorTransOpen.Readonly = true;
                    dgDebtorTransOpen.tableView.CloseEditor();
                    ibase.Caption = Uniconta.ClientTools.Localization.lookup("EditAll");
                    ribbonControl.DisableButtons("SaveGrid");
                    copyRowIsEnabled = false;
                }
            }
        }