
24/12/2007, 11:00
|
| | Fecha de Ingreso: agosto-2006
Mensajes: 99
Antigüedad: 18 años, 6 meses Puntos: 0 | |
Re: seleccionar fila en datagridview(solucionado) private void dgrConsulta_DoubleClick(object sender, EventArgs e)
{
int i;
i = dgrConsulta.CurrentRow.Index;
if (i != -1)
{
if (this.dgrConsulta.Rows[i].Selected == true)
{
this.txtcodigo.Text = dgrConsulta.Rows[i].Cells[0].Value.ToString();
this.txtCaso.Text = dgrConsulta.Rows[i].Cells[1].Value.ToString();
//pasar el valo de fecha del dgr al datetimepicker
fecha = dgrConsulta.Rows[i].Cells[2].Value.ToString();
anno = fecha.Substring(0, 4);
dia = fecha.Substring(4, 2);
mes = fecha.Substring(6, 2);
fecha = dia + "/" + mes + "/" + anno;
dtpFecha.Value = DateTime.Parse(fecha);
}
}
} |