예제 #1
0
 private void bandedGridView1_InvalidValueException(object sender, DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs e)
 {
     if (MessageBox.Show(e.ErrorText, "提醒", MessageBoxButtons.OK) == DialogResult.OK)
     {
         e.ExceptionMode = ExceptionMode.Ignore;
     }
 }
예제 #2
0
        private void gvVentaDetalle_InvalidValueException(object sender, DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs e)
        {
            switch ((sender as GridView).FocusedColumn.FieldName)
            {
            case "cantidad":
                e.ExceptionMode = ExceptionMode.DisplayError;
                e.WindowCaption = "Cantidad";
                e.ErrorText     = "La cantidad debe ser mayor a 0";
                break;

            case "dv":
                e.ExceptionMode = ExceptionMode.DisplayError;
                e.WindowCaption = "Descuento de venta";
                e.ErrorText     = "La cantidad debe ser mayor o igual a 0 y menor que 100";
                break;

            case "dv2":
                e.ExceptionMode = ExceptionMode.DisplayError;
                e.WindowCaption = "Descuento de venta";
                e.ErrorText     = "La cantidad debe ser mayor o igual a 0";
                break;
            }

            //Destroying the editor and discarding the changes made within the edited cell.
            gvVentaDetalle.HideEditor();
        }
예제 #3
0
        private void UiPropertyGridZona_InvalidValueException(object sender, DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs e)
        {
            var vGrid = sender as PropertyGridControl;

            e.ExceptionMode = ExceptionMode.DisplayError;
            e.WindowCaption = "Error";
            e.ErrorText     = "Caracteres Invalidos, por favor revise";

                        // Destroying the editor and discarding the wrong changes made within the edited cell
                        vGrid.HideEditor();
        }
예제 #4
0
        private void gvVentasDetalle_InvalidValueException(object sender, DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs e)
        {
            switch ((sender as GridView).FocusedColumn.FieldName)
            {
            case "cantidad":
                e.ExceptionMode = ExceptionMode.DisplayError;
                e.WindowCaption = "Cantidad";
                e.ErrorText     = "La cantidad debe ser mayor a 0";
                break;

            case "dv":
                e.ExceptionMode = ExceptionMode.DisplayError;
                e.WindowCaption = "Descuento de venta";
                e.ErrorText     = "La cantidad debe ser mayor o igual a 0 y menor que 100";
                break;

            case "dv2":
                e.ExceptionMode = ExceptionMode.DisplayError;
                e.WindowCaption = "Descuento de venta";
                e.ErrorText     = "La cantidad debe ser mayor a 0";
                break;
            }
        }
예제 #5
0
 private void te_InvalidValue(object sender, DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs e)
 {
     e.ExceptionMode = ExceptionMode.DisplayError;
     e.ErrorText     = "Không được để trống";
 }