private void gridOfertas_CellClick(object sender, DataGridViewCellEventArgs e) { int i = e.RowIndex; if (i >= 0) { current = getRow(i); numCantidad.Maximum = current.MaxPorCliente; } }
private void showOfertas(List <Modelos.Oferta> ofertas) { gridOfertas.DataSource = ofertas; //gridOfertas.AutoResizeColumns(); if (ofertas != null) { gridOfertas.Rows[0].Selected = true; current = getRow(0); int maxCliente = ((Modelos.Oferta)gridOfertas.Rows[0].DataBoundItem).MaxPorCliente; int cantDisponible = ((Modelos.Oferta)gridOfertas.Rows[0].DataBoundItem).CantDisponible; if (maxCliente < cantDisponible) { numCantidad.Maximum = maxCliente; } else { numCantidad.Maximum = cantDisponible; } } }