private void ultraGrid2_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { int col = 0; string Columna = ""; // e.Cell.Row.Cells.GetItem(0); //char.IsNumber //int x=0; //for ( x=0;x<e.Cell.Value.ToString().Length;x++ ) // //e.Cell.Value.ToString() //{ // char.IsNumber(e.Cell.Value.ToString().Substring(x, 1)); //} if (e.Cell.Column.Key.ToString().ToUpper() == "CANTIDAD") { if (Entra > 0) { //e.Cell.Value = ""; e.Cell.Value = ""; MessageBox.Show("No puede actualizar los datos..."); return; } } Columna = e.Cell.Column.Key.ToString().ToUpper(); foreach (Infragistics.Win.UltraWinGrid.UltraGridRow Rn in ultraGrid2.Rows) { if (Rn.Cells[0].Value.ToString() != "" && Rn.Cells[1].Value.ToString() != "" && Rn.Cells[2].Value.ToString() != "" && Rn.Cells[3].Value.ToString() != "" && Rn.Cells[4].Value.ToString() != "") { ClsKit.AddNewRowArtKitMan(1, Convert.ToInt32(Rn.Cells[0].Value), Convert.ToString(Rn.Cells[1].Value).ToUpper(), Convert.ToString(Rn.Cells[2].Value).ToUpper(), Convert.ToInt32(Rn.Cells[3].Value), Convert.ToDouble(Rn.Cells[4].Value)); } } if (Columna == "PRECIOU") { ClsKit.AddNewRowArtKitMan(3, 0, "", "", 0, 0); ListKit = ClsKit.ListArtKit(); ultraGrid2.DataSource = ListKit; int rows = 0; rows = ultraGrid2.Rows.Count; ultraGrid2.Rows[rows - 1].Cells[1].Activated = true; //e.Cell.Activated = true; } }
private void btnMas_Click(object sender, EventArgs e) { ClsKit.AddNewRowArtKitMan(3, 0, "", "", 0, 0); ListKit = ClsKit.ListArtKit(); ultraGrid2.DataSource = ListKit; }