private void dataLista_CellMouseDoubleClick_1(object sender, DataGridViewCellMouseEventArgs e) { if (dataLista.Rows.Count > 0) { DateTime date = Convert.ToDateTime(this.dataLista.CurrentRow.Cells["fecha"].Value); FrmDetalleVentas venta = new FrmDetalleVentas(Convert.ToString(this.dataLista.CurrentRow.Cells["codigo"].Value), Convert.ToString(this.dataLista.CurrentRow.Cells["Razon_social"].Value), date.ToShortDateString(), Convert.ToString(this.dataLista.CurrentRow.Cells["tipo_comprobante"].Value), Convert.ToString(this.dataLista.CurrentRow.Cells["estado"].Value), Convert.ToString(Decimal.Round(Convert.ToDecimal(this.dataLista.CurrentRow.Cells["total"].Value), 2)) , Convert.ToString(this.dataLista.CurrentRow.Cells["idcliente"].Value), Convert.ToString(this.dataLista.CurrentRow.Cells["cuit"].Value)); venta.ShowDialog(); } }
private void dataLista_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) { DTDetalleventa.DataSource = NegocioVenta.MostrarDetalle(dataLista.CurrentRow.Cells["Codigo"].Value.ToString()); } if (e.KeyCode == Keys.Enter) { if (dataLista.Rows.Count > 0) { DateTime date = Convert.ToDateTime(this.dataLista.CurrentRow.Cells["fecha"].Value); FrmDetalleVentas venta = new FrmDetalleVentas(Convert.ToString(this.dataLista.CurrentRow.Cells["codigo"].Value), Convert.ToString(this.dataLista.CurrentRow.Cells["razon_social"].Value), date.ToShortDateString(), Convert.ToString(this.dataLista.CurrentRow.Cells["tipo_comprobante"].Value), Convert.ToString(this.dataLista.CurrentRow.Cells["estado"].Value), Convert.ToString(Decimal.Round(Convert.ToDecimal(this.dataLista.CurrentRow.Cells["total"].Value), 2)) , Convert.ToString(this.dataLista.CurrentRow.Cells["idcliente"].Value), Convert.ToString(this.dataLista.CurrentRow.Cells["cuit"].Value)); venta.ShowDialog(); } } }