private void dgvDatos_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e) { try { decimal original = decimal.Zero; decimal reubicar = decimal.Zero; original = Convert.ToDecimal(dgvDatos.Rows[e.Cell.Row.Index].Cells["Cantidad"].Text); reubicar = Convert.ToDecimal(dgvDatos.Rows[e.Cell.Row.Index].Cells["QtyOK"].Text); if (reubicar > original) { this.SetMensaje("Cantidad no disponible!!!", 5000, Color.Red, Color.White); e.Cancel = true; return; } else { this.SetMensaje(string.Empty, 5000, Color.Green, Color.White); } } catch (Exception) { } }
private void ultraGrid2_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e) { int x = 0; char aux = ' '; Entra = 0; if (e.Cell.Text.ToString() != "") { for (x = 0; x < e.Cell.Text.ToString().Length; x++) //e.Cell.Value.ToString() { aux = Convert.ToChar(e.Cell.Text.ToString().Substring(x, 1)); if (!char.IsNumber(aux)) { Entra++; } } } }