private void bandedGridView1_InvalidValueException(object sender, DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs e) { if (MessageBox.Show(e.ErrorText, "提醒", MessageBoxButtons.OK) == DialogResult.OK) { e.ExceptionMode = ExceptionMode.Ignore; } }
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(); }
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(); }
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; } }
private void te_InvalidValue(object sender, DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs e) { e.ExceptionMode = ExceptionMode.DisplayError; e.ErrorText = "Không được để trống"; }