Beispiel #1
0
 private void gridView1_GroupRowCollapsing(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     if (e.RowHandle != -1)
     {
         e.Allow = false;
     }
 }
Beispiel #2
0
 void gvMain_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     if (!ceRong.Properties.ReadOnly)
     {
         focusing = true;
     }
 }
Beispiel #3
0
 private void GridView_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     if (dxValidationProvider != null && !dxValidationProvider.Validate())
     {
         e.Allow = false;
     }
 }
Beispiel #4
0
        private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (ConsrtBindingSource.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, (CONSRT)ConsrtBindingSource.Current);
                }


                cODETextEdit.Properties.ReadOnly = true;
                GridViewConsrt.Columns.ColumnByName(colName).OptionsColumn.AllowEdit = false;
            }
            else
            {
                if (!temp && !modified)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CONSRT)ConsrtBindingSource.Current);
                }

                e.Allow = false;
            }
        }
Beispiel #5
0
        private void gvRegionMaster_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            bool bComp, bOpComp;

            bComp   = DoBeforeClose("C", ref dtCompList4Reg);
            bOpComp = DoBeforeClose("O", ref dtOpCompList4Reg);

            e.Allow = !bComp && !bOpComp;
        }
Beispiel #6
0
 private void gvDetail_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         e.Allow = Valid();
     }
     catch (Exception ex)
     { MsgBox.ShowError(ex.Message); }
 }
Beispiel #7
0
 private void UiVistaMasterPackEncabezado_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         MarcarMasterPackEncabezado();
     }
     catch (Exception)
     {
     }
 }
Beispiel #8
0
 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);
     }
 }
Beispiel #9
0
 private void gridView2_RowLeaveSave(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     /*只有在表非空的情况下才进行,否则检索溢出*/
     if (gridView2.RowCount != 0)
     {
         /*获取当前选中的课程号*/
         int    selectedHandle = this.gridView2.GetSelectedRows()[0];
         string Grade          = this.gridView2.GetRowCellValue(selectedHandle, "Grade").ToString();
         string Sno            = this.gridView2.GetRowCellValue(selectedHandle, "Sno").ToString();
     }
 }
Beispiel #10
0
 private void UiListaPiloto_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiListaPiloto.RowCount; i++)
     {
         var registro = (Piloto)UiListaPiloto.GetRow(i);
         if (registro == null) continue;
         if (registro.IS_SELECTED)
         {
             UiListaPiloto.SelectRow(i);
         }
     }
 }
Beispiel #11
0
        private void grdvPWOs_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            int idx = grdvPWOs.GetFocusedDataSourceRowIndex();

            if (idx >= 0 && idx < pwos.Count)
            {
                if (!AlertConfirm())
                {
                    e.Allow = false;
                }
            }
        }
Beispiel #12
0
 private void gvDetail_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         labelControl1.Focus();
         gvDetail.CloseEditor();
         labelControl1.Focus();
         e.Allow = Valid();
     }
     catch (Exception ex)
     { MsgBox.ShowError(ex.Message); }
 }
Beispiel #13
0
        /// <summary>
        ///  点击gridViewSymbol前记录下之前选中的行对应的ID
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridViewSymbol_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            if (gridViewSymbol.FocusedRowHandle < -1)
            {
                return;
            }
            DataRowView dr = (DataRowView)gridViewSymbol.GetRow(gridViewSymbol.FocusedRowHandle);

            if (dr == null)
            {
                return;
            }
            old_SymbolID = dr["ID"].ToString();
        }
Beispiel #14
0
 private void UiVistaBodegas_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiVistaBodegas.RowCount; i++)
     {
         var bodega = (Bodega)UiVistaBodegas.GetRow(i);
         if (bodega == null)
         {
             continue;
         }
         if (bodega.IS_SELECTED)
         {
             UiVistaBodegas.SelectRow(i);
         }
     }
 }
 private void UiListaVistaClientes_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiListaVistaClientes.RowCount; i++)
     {
         var documento = (Cliente)UiListaVistaClientes.GetRow(i);
         if (documento == null)
         {
             continue;
         }
         if (documento.IS_SELECTED)
         {
             UiListaVistaClientes.SelectRow(i);
         }
     }
 }
 private void UiVistaInventarioComprometido_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiVistaInventarioComprometido.RowCount; i++)
     {
         var documento = (InventarioComprometidoEncabezado)UiVistaInventarioComprometido.GetRow(i);
         if (documento == null)
         {
             continue;
         }
         if (documento.IS_SELECTED)
         {
             UiVistaInventarioComprometido.SelectRow(i);
         }
     }
 }
Beispiel #17
0
 private void UiViewZonasDeReabastecimiento_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiViewZonasDeReabastecimiento.RowCount; i++)
     {
         var documento = (Zona)UiViewZonasDeReabastecimiento.GetRow(i);
         if (documento == null)
         {
             continue;
         }
         if (documento.IS_SELECTED)
         {
             UiViewZonasDeReabastecimiento.SelectRow(i);
         }
     }
 }
Beispiel #18
0
 private void UiVistaSolicitud_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiVistaSolicitud.RowCount; i++)
     {
         var solicitud = (SolicitudDeTrasladoEncabezado)UiVistaSolicitud.GetRow(i);
         if (solicitud == null)
         {
             continue;
         }
         if (solicitud.IS_SELECTED)
         {
             UiVistaSolicitud.SelectRow(i);
         }
     }
 }
Beispiel #19
0
 private void gvl_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         MemoryStream ms = new MemoryStream();
         ssc.SaveDocument(ms, DevExpress.Spreadsheet.DocumentFormat.Xlsx);
         byte[] bytes = ms.ToArray();
         gvl.SetFocusedRowCellValue("Prototype_Sheet", bytes);
     }
     catch (Exception ex)
     {
         SharedFunc.RaiseError(ex);
     }
 }
Beispiel #20
0
 private void UiVistaCentroDeDistribucion_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiVistaCentroDeDistribucion.RowCount; i++)
     {
         var centro = (Entidades.Configuracion)UiVistaCentroDeDistribucion.GetRow(i);
         if (centro == null)
         {
             continue;
         }
         if (centro.IS_SELECTED)
         {
             UiVistaCentroDeDistribucion.SelectRow(i);
         }
     }
 }
 private void UiListaVistaRuntaVendedor_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiListaVistaRuntaVendedor.RowCount; i++)
     {
         var registro = (Ruta)UiListaVistaRuntaVendedor.GetRow(i);
         if (registro == null)
         {
             continue;
         }
         if (registro.IS_SELECTED)
         {
             UiListaVistaRuntaVendedor.SelectRow(i);
         }
     }
 }
 private void gvDetail_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         e.Allow = Valid();
         DetailQueryInfo CurrQueryInfo = bsDetailQuery[e.RowHandle] as DetailQueryInfo;
         if (CurrQueryInfo == null)
         {
             return;
         }
         CurrQueryInfo.Condition = bsCondition.List as IList <DetailCondition>;
         CurrQueryInfo.sqlStr    = rbtSQL.Text;
     }
     catch (Exception ex)
     { MsgBox.ShowError(ex.Message); }
 }
Beispiel #23
0
 /// <summary>
 /// 离开行时判断
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gvPadset_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         this.labelControl1.Focus();
         this.gvPadset.CloseEditor();
         PdaOperSetInfo currrow = this.bsPadset.Current as PdaOperSetInfo;
         if (currrow != null)
         {
             e.Allow = Vaild(currrow);
         }
     }
     catch (Exception ex)
     {
         MsgBox.ShowError(ex.Message);
     }
 }
 private void gvDetail_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         gvPass.BeforeLeaveRow -= gvPass_BeforeLeaveRow;
         labelControl1.Focus();
         gvDetail.CloseEditor();
         labelControl1.Focus();
         e.Allow = Valid();
         if (!e.Allow)
         {
             return;
         }
         if (gvDetail.FocusedRowHandle >= 0)
         {
             TaskConfigDetail CurrDetail = bsDetail[gvDetail.FocusedRowHandle] as TaskConfigDetail;
             if (CurrDetail != null)
             {
                 if (gvPass.FocusedRowHandle >= 0)
                 {
                     TaskConfigMustPass CurrConfigPass = baPass[gvPass.FocusedRowHandle] as TaskConfigMustPass;
                     if (CurrConfigPass != null)
                     {
                         if (string.IsNullOrEmpty(CurrConfigPass.MustPassLandCode))
                         {
                             baPass.RemoveCurrent();
                         }
                     }
                     IList <IOActionInfo> Actions = bsIOActions.List as IList <IOActionInfo>;
                     CurrConfigPass.MustPassIOAction = Actions;
                 }
                 IList <TaskConfigMustPass> ConfigMustPasss = baPass.List as List <TaskConfigMustPass>;
                 if (ConfigMustPasss != null)
                 {
                     CurrDetail.TaskConfigMustPass = DataToObject.CreateDeepCopy <IList <TaskConfigMustPass> >(ConfigMustPasss);
                 }
             }
         }
     }
     catch (Exception ex)
     { MsgBox.ShowError(ex.Message); }
     finally
     { gvPass.BeforeLeaveRow += gvPass_BeforeLeaveRow; }
 }
Beispiel #25
0
 private void gvCategory_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         IList <SysOperButton> bs = bsSysOperButton.List as List <SysOperButton>;
         UserCategory          uc = bsCategory.Current as UserCategory;
         if (uc == null)
         {
             return;
         }
         int count = uc.CategoryList.Count;
         for (int i = count - 1; i >= 0; i--)
         {
             if (uc.CategoryList[i].CategoryCode == uc.CategoryCode)
             {
                 uc.CategoryList.RemoveAt(i);
             }
         }
         foreach (var item in bs)
         {
             if (item.IsSelect == true)
             {
                 uc.CategoryList.Add(new SysOprButtonToCategory()
                 {
                     CategoryCode = uc.CategoryCode,
                     ButtonName   = item.ButtonName,
                     ButtonType   = item.ButtonType
                 });
             }
         }
         bsCategory.ResetBindings(false);
     }
     catch (Exception ex)
     {
         MsgBox.ShowError(ex.Message);
     }
 }
 private void gvPass_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     try
     {
         if (gvPass.FocusedRowHandle < 0)
         {
             return;
         }
         TaskConfigMustPass CurrConfigPass = baPass[gvPass.FocusedRowHandle] as TaskConfigMustPass;
         if (CurrConfigPass != null)
         {
             IList <TaskConfigMustPass> AllPassLands = baPass.List as IList <TaskConfigMustPass>;
             if (AllPassLands != null && AllPassLands.Count(p => p.MustPassLandCode == CurrConfigPass.MustPassLandCode) > 1)
             {
                 gvPass.FocusedColumn = colMustPassLandCode;
                 gvPass.ShowEditor();
                 e.Allow = false;
                 return;
             }
             if (string.IsNullOrEmpty(CurrConfigPass.MustPassLandCode))
             {
                 gvPass.FocusedColumn = colMustPassLandCode;
                 gvPass.ShowEditor();
                 e.Allow = false;
                 return;
             }
             IList <IOActionInfo> IOActions = bsIOActions.List as List <IOActionInfo>;
             if (IOActions != null)
             {
                 CurrConfigPass.MustPassIOAction = DataToObject.CreateDeepCopy <IList <IOActionInfo> >(IOActions);
             }
         }
     }
     catch (Exception ex)
     { MsgBox.ShowError(ex.Message); }
 }
Beispiel #27
0
 private void gridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
 }
 private void UiVistaInventario_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     MarcarInventarioSeleccionado();
 }
Beispiel #29
0
 private void gvUserDataView_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     // loadScreenData();
 }
Beispiel #30
0
 private void gridViewModrecordgridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     this.gridViewModrecord.GridView1.OptionsBehavior.Editable = false;
 }