Example #1
0
 private void gridcontrol_GroupRowCollapsing(object sender, RowAllowEventArgs e)
 {
     if (e.Row != null && e.Row is UserViewModel user && DataContext is SchedulerViewModel model)
     {
         model.Users.Where(x => x.Department == user.Department).ToList().ForEach(x => x.IsVisible = false);
     }
 }
Example #2
0
        private void advBandedGridView1_BeforeLeaveRow(object sender, RowAllowEventArgs e)
        {
            if (LookupBindingSource.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, (LOOKUP)LookupBindingSource.Current);
                }
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (LOOKUP)LookupBindingSource.Current);
                }

                e.Allow = false;
            }
        }
        private void layoutViewBills_BeforeLeaveRow(object sender, RowAllowEventArgs e)
        {
            if (layoutViewBills.IsNewItemRow(layoutViewBills.FocusedRowHandle))
            {
                if (MessageBox.Show("Do you want to save this new bill?", "Quession", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    ribbonPageFind.Visible = false;
                    if (gridControl.MainView != cardViewBillDetails)
                    {
                        bindingSource.DataSource = _repBillDetails.Find(dt => dt.BillID == -1).ToList();

                        ribbonPageGroupDetailOptions.Visible = true;
                        btnDetailsAll.Enabled  = false;
                        btnDetailsSave.Enabled = false;
                        btnShowDetails.Enabled = false;

                        gridControl.MainView        = cardViewBillDetails;
                        ribbonPageGroupFile.Visible = false;
                    }
                    isNew = true;
                }
                else
                {
                    btnAll.PerformClick();
                }
            }
        }
 private void gridControl1_GroupRowCollapsing(object sender, RowAllowEventArgs e)
 {
     if (e.Row == null || ((Invoice)e.Row).Status == InvoiceStatus.Invalidated && colStatus.GroupIndex != -1)
     {
         e.Allow = false;
     }
 }
Example #5
0
        private void GridViewSvcRestr_BeforeLeaveRow(object sender, RowAllowEventArgs e)
        {
            if (SvcRestrBindingSource.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, (SVCRESTR)SvcRestrBindingSource.Current);
                }

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

                e.Allow = false;
            }
        }
Example #6
0
        static void OnGroupRowExpanding(object sender, RowAllowEventArgs e)
        {
            TableView view = (e.Source as TableView);

            view.BeginSelection();
            SelectChild(view, e.RowHandle);
            view.EndSelection();
        }
Example #7
0
        static void OnGroupRowExpanding(object sender, RowAllowEventArgs e)
        {
            var grid = (GridControl)sender;

            grid.BeginSelection();
            SelectChild(grid, e.RowHandle);
            grid.EndSelection();
        }
 void View_BeforeLeaveRow(object sender, RowAllowEventArgs e)
 {
     if (Control.MouseButtons == MouseButtons.Left) {	//Don't change focus when a checkbox is clicked
         var hitInfo = View.CalcHitInfo(View.GridControl.PointToClient(Control.MousePosition));
         if (hitInfo.Column == CheckColumn && hitInfo.HitTest == GridHitTest.RowCell)
             e.Allow = false;
     }
 }
Example #9
0
 private void GridViewOnBeforeLeaveRow(object sender, RowAllowEventArgs rowAllowEventArgs)
 {
     if (!rowAllowEventArgs.Allow)
     {
         return;
     }
     rowAllowEventArgs.Allow = OnItemChanging(sender, _gridView.GetRow(rowAllowEventArgs.RowHandle));
 }
 private void gridControl1_GroupRowExpanding(object sender, RowAllowEventArgs e)
 {
     if (e.Row == null ||
         ((Invoice)e.Row).Status == InvoiceStatus.Invalidated &&
         gridControl1.Columns["Status"].GroupIndex != -1)
     {
         e.Allow = false;
     }
 }
 private void gridViewProduct_BeforeLeaveRow(object sender, 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);
     }
 }
Example #12
0
        private void Vista_BeforeLeaveRow(object sender, RowAllowEventArgs e)
        {
            var vista = sender as GridView;

            if (vista == null)
            {
                return;
            }
            RecargarSeleccionDeVista(vista);
        }
Example #13
0
 void View_BeforeLeaveRow(object sender, RowAllowEventArgs e)
 {
     if (Control.MouseButtons == MouseButtons.Left)                      //Don't change focus when a checkbox is clicked
     {
         var hitInfo = View.CalcHitInfo(View.GridControl.PointToClient(Control.MousePosition));
         if (hitInfo.Column == CheckColumn && hitInfo.HitTest == GridHitTest.RowCell)
         {
             e.Allow = false;
         }
     }
 }
Example #14
0
        private void advBandedGridView1_BeforeLeaveRow(object sender, RowAllowEventArgs e)
        {
            ColumnView view    = advBandedGridView1;
            GridColumn column1 = view.Columns["LINK_TABLE"];
            GridColumn column2 = view.Columns["LINK_COLUMN"];
            GridColumn column3 = view.Columns["DESC"];

            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 (UserFieldsBindingSource.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, (USERFIELDS)UserFieldsBindingSource.Current);
                }
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (USERFIELDS)UserFieldsBindingSource.Current);
                }

                e.Allow = false;
            }
        }
Example #15
0
 /// <summary>
 /// XtraGridView在行变化时,触发此事件,在事件中调用DoSave提交行数据的修改
 /// </summary>
 private void XtraGridView_BeforeLeaveRow(object sender, RowAllowEventArgs e)
 {
     try
     {
         if (masterBindingSource.Current != null)
         {
             DataRow dr = ((DataRowView)masterBindingSource.Current).Row;
             if (dr == browseXtraGridView.GetDataRow(e.RowHandle))
             {
                 if (dr.RowState != DataRowState.Unchanged)
                 {
                     //if (MessageHandler.ShowMessageBox_YesNo("确认是否保存当前行信息?") == DialogResult.Yes)
                     if (MessageHandler.ShowMessageBox_YesNo(f.tsmiQrsfbcdqhxx.Text) == DialogResult.Yes)
                     {
                         if (!btnSave_Click())
                         {
                             e.Allow = false;
                         }
                     }
                     else
                     {
                         dr.RejectChanges();
                         Set_Button_State(true);
                         Set_EditZone_ControlReadOnly(true);
                     }
                 }
                 else
                 {
                     Set_Button_State(true);
                     Set_EditZone_ControlReadOnly(true);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         //ExceptionHandler.HandleException(this.Text + "--刷新按钮事件错误。", ex);
         ExceptionHandler.HandleException(this.Text + "--" + f.tsmiSxansjcw.Text, ex);
     }
 }
 private void layoutViewStockReceiveds_BeforeLeaveRow(object sender, RowAllowEventArgs e)
 {
     if (isNew)
     {
         var dlg = MessageBox.Show("This row is new and not save! Do you want save it", "Error", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
         if (dlg == DialogResult.No)
         {
             btnAll.PerformClick();
         }
         else
         {
             stockId = 0;
             btnSave.PerformClick();
             var newStock = layoutViewStockReceiveds.GetRow(layoutViewStockReceiveds.DataRowCount - 1) as StockReceived;
             _manager.InsertOrUpdate(newStock);
             xtraTabControl1.SelectedTabPage = xtraTabPage2;
             MessageBox.Show(stockId.ToString());
             xtraTabPage1.PageEnabled = false;
             e.Allow = false;
         }
     }
 }
Example #17
0
 /// <summary>
 /// 换行触发事件
 /// </summary>
 private void gridViewQuotation_BeforeLeaveRow(object sender, RowAllowEventArgs e)
 {
     try
     {
         if (gridViewQuotation.GetFocusedDataRow() != null)
         {
             DataRow dr = gridViewQuotation.GetFocusedDataRow();
             if (dr.RowState != DataRowState.Unchanged)
             {
                 MessageHandler.ShowMessageBox("当前报价单正在编辑,请保存后再进行换行。");
                 e.Allow = false;
             }
             else
             {
                 Set_ButtonEditGrid_State(true);
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(this.Text + "--换行触发事件错误。", ex);
     }
 }
Example #18
0
 private void inspectionView_BeforeLeaveRow(object sender, RowAllowEventArgs e)
 {
     GridView v = sender as GridView;
     PipeTest pipeTest = v.GetRow(e.RowHandle) as PipeTest;
     if (CurrentPipeMillSizeType != null)
     {
         foreach (PipeTest t in CurrentPipeMillSizeType.PipeTests)
         {
             t.pipeType = CurrentPipeMillSizeType;
         }
     }
 }
Example #19
0
 void view_GroupRowCollapsing(object sender, RowAllowEventArgs e)
 {
     e.Allow = false;
 }
 void grdProductDetails_GroupRowExpanding(object sender, RowAllowEventArgs e)
 {
     LongTaskExecutor.RaiseLongTaskEvent(sender, new LongTaskEventArgs("Expanding product details", TaskStatus.Started));
 }
Example #21
0
 private void gridView_BeforeLeaveRow(object sender, RowAllowEventArgs e) {
     if (e.Allow) {
         if (!((ISupportNewItemRow)gridView).IsNewItemRowCancelling) {
             e.Allow = OnFocusedObjectChanging();
         }
     }
 }
Example #22
0
 private void grdvOrders_BeforeLeaveRow(object sender, RowAllowEventArgs e)
 {
     grdvOrders.BestFitColumns();
 }