コード例 #1
0
ファイル: BusTableForm.cs プロジェクト: mdgiles/TraceOffice
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (BusTableBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BUSTABLE)BusTableBindingSource.Current);
                }
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BUSTABLE)BusTableBindingSource.Current);
                }
                e.Allow = false;
            }
        }
コード例 #2
0
 private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     if (!gridView2.PostEditor() || !gridView1.UpdateCurrentRow())
     {
         e.Allow = false;
     }
 }
コード例 #3
0
        private void gridViewUsers_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (!ignoreLeaveRow)
            {
                if (UsersBindingSource.Current == null)
                {
                    e.Allow = true;
                    return;
                }

                temp = newRec;
                bool temp2 = modified;
                if (checkForms(true))
                {
                    e.Allow = true;
                    if ((!temp) && temp2)
                    {
                        context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (ExtranetUser)UsersBindingSource.Current);
                    }

                    setReadOnly(true);
                }
                else
                {
                    if (!temp && !modified)
                    {
                        context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (ExtranetUser)UsersBindingSource.Current);
                    }

                    e.Allow = false;
                }
            }
        }
コード例 #4
0
ファイル: HtlBrandForm.cs プロジェクト: mdgiles/TraceOffice
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (HtlBrandBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            ((HTLBRAND)HtlBrandBindingSource.Current).ImagesRoot = imagesRoot;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (HTLBRAND)HtlBrandBindingSource.Current);
                }
                cODETextEdit.Properties.ReadOnly = true;
                GridViewHtlBrand.Columns.ColumnByName(colName).OptionsColumn.AllowEdit = false;
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (HTLBRAND)HtlBrandBindingSource.Current);
                }

                e.Allow = false;
            }
        }
コード例 #5
0
ファイル: CarOffForm.cs プロジェクト: mdgiles/TraceOffice
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (CarOffBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }

            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                errorProvider1.Clear();
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CAROFF)CarOffBindingSource.Current);
                }
                setReadOnly(true);
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CAROFF)CarOffBindingSource.Current);
                }

                e.Allow = false;
            }
        }
コード例 #6
0
ファイル: SvcRestr2Form.cs プロジェクト: mdgiles/TraceOffice
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (SvcRestr2BindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR2)SvcRestr2BindingSource.Current);
                }
                //codeTextEdit.Properties.ReadOnly = true;
                //gridView1.Columns.ColumnByName(colName1).OptionsColumn.AllowEdit = false;
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (SVCRESTR2)SvcRestr2BindingSource.Current);
                }

                e.Allow = false;
            }
        }
コード例 #7
0
ファイル: LanguageForm.cs プロジェクト: mdgiles/TraceOffice
 private void GridViewLookup_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     //If the user selects a row, edits, then selects the auto-filter row, then selects a different row,
     //this event will fire for the auto-filter row, so we cannot ignore it because there is still a record
     //that may need to be saved. 
     if (!_ignoreLeaveRow && IsModified(_selectedRecord)) {
         e.Allow = SaveRecord(true);
     }
 }
コード例 #8
0
ファイル: DigHdrForm.cs プロジェクト: mdgiles/TraceOffice
        private void advBandedGridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            //if (DigHdrBindingSource.Current == null)
            //{
            //    e.Allow = true;
            //    return;
            //}

            //temp = newRec;
            //bool temp2 = modified;
            //if (checkForms())
            //{
            //    errorProvider1.Clear();
            //    e.Allow = true;  if (!temp && !modified)
            // context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);

            //    if ((!temp) && temp2)
            //        context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);


            //    agencySearch.ButtonEdit.Properties.ReadOnly = true;
            //    cOUP_RESTextEdit.Properties.ReadOnly = true;

            //}
            //else
            //    e.Allow = false;
            if (DigHdrBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);
                }
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);
                }

                e.Allow = false;
            }
        }
コード例 #9
0
ファイル: BookSelForm.cs プロジェクト: mdgiles/TraceOffice
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            ColumnView view    = gridView1;
            GridColumn column1 = view.Columns["Link_Table"];
            GridColumn column2 = view.Columns["Link_Column"];
            GridColumn column3 = view.Columns["Description"];

            string val1 = (string)view.GetFocusedRowCellValue(column1);
            string val2 = (string)view.GetFocusedRowCellValue(column2);
            string val3 = (string)view.GetFocusedRowCellValue(column3);

            if ((string.IsNullOrWhiteSpace(val1) || string.IsNullOrWhiteSpace(val2) || string.IsNullOrWhiteSpace(val3)) && newRec == true)
            {
                e.Allow = false;
                return;
            }

            if (BookSelBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }

            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BookSel)BookSelBindingSource.Current);
                }
            }
            else
            {
                if ((!temp) && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (BookSel)BookSelBindingSource.Current);
                }

                e.Allow = false;
            }
        }
コード例 #10
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (contactNewRowRec == true)
            {
                MessageBox.Show("Please save or delete the new record being added in the grid on the Contacts tab before attempting to navigate to another record.");
                e.Allow = false;
                return;
            }

            if (OperatorBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }

            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                errorProvider1.Clear();
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (OPERATOR)OperatorBindingSource.Current);
                }

                setReadOnly(true);
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (OPERATOR)OperatorBindingSource.Current);
                }

                e.Allow = false;
            }
        }
コード例 #11
0
        private void advBandedGridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            ColumnView view    = advBandedGridView1;
            GridColumn column1 = view.Columns["CODE"];
            GridColumn column2 = view.Columns["ITIN"];


            string val1 = (string)view.GetFocusedRowCellValue(column1);
            string val2 = (string)view.GetFocusedRowCellValue(column2);

            if ((string.IsNullOrWhiteSpace(val1) || string.IsNullOrWhiteSpace(val2)) && newRec == true)
            {
                e.Allow = false;
                return;
            }

            if (CruItItemBindingSource.Current == null)
            {
                e.Allow = true;
                return;
            }
            temp = newRec;
            bool temp2 = modified;

            if (checkForms())
            {
                e.Allow = true;
                if ((!temp) && temp2)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CRUITItem)CruItItemBindingSource.Current);
                }
            }
            else
            {
                e.Allow = false;
            }
        }
コード例 #12
0
ファイル: FrmStdField.cs プロジェクト: yyan/winform
 private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     gridView1.OptionsBehavior.Editable = false;
 }
コード例 #13
0
 private void GroupRowExpanding(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
 }