DataGridView
Publicado por Federico (1 intervención) el 20/08/2018 00:51:12
Buenas tardes, en el evento DoubleClick de un DataGridView tengo el sig codigo:
Me encuentro con este problema, cuando realizo por primera vez el dobleclick en alguna fila del DataListado funciona todo el resto del codigo normalmente, ahora selecciono otra fila realizando dobleclick nuevamente para ver los resultados y no copia nada a los TextBox y tampoco me muestra los detalles, pero vuelvo a intentar un dobleclick en la misma fila o en otra y vuelve a funcionar correctamente todo, es decir que hay un intervalo entre un dobleclick a otro, en el medio no realiza nada. Alguien me podria decir cual es el error. Muchas gracias.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
private void dataListado_DoubleClick(object sender, EventArgs e)
{
if (dataListado.RowCount != 0)
{
this.txtIdventa.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["idventa"].Value);
this.txtCliente.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["cliente"].Value);
this.dtpFecha.Value = Convert.ToDateTime(this.dataListado.CurrentRow.Cells["fecha"].Value);
this.cbComprobante.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["comprobante"].Value);
this.txtCentro.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["centro"].Value);
this.txtNumero.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["numero"].Value);
this.lblTotalVendido.Text = ((decimal)this.dataListado.CurrentRow.Cells["total"].Value).ToString("#,##0.00");
this.lblTotalPagado.Text = ((decimal)this.dataListado.CurrentRow.Cells["total"].Value).ToString("#,##0.00");
if ((this.cbComprobante.Text == "Venta"))
{
this.MostrarDetalleVenta();
this.MostrarDetallePagos();
this.tcVentas.SelectedIndex = 1;
this.txtIdventa.ReadOnly = true;
this.txtIVA.ReadOnly = true;
}
else
{
if ((this.cbComprobante.Text == "Anulacion" || this.cbComprobante.Text == "Devolucion"))
{
this.MostrarAnulacionVenta();
this.MostrarDetallePagos();
this.tcVentas.SelectedIndex = 1;
this.txtIdventa.ReadOnly = true;
this.txtIVA.ReadOnly = true;
}
}
}
}
Valora esta pregunta


0