Ejecutar Dgv_CellClick(sender,e)
Publicado por Miguel (281 intervenciones) el 26/06/2016 19:11:30
Hola tengo hecho este código
Y trato de ejecutarlo con
y me muestra este error
Message --- No se puede convertir un objeto de tipo 'System.EventArgs' al tipo 'System.Windows.Forms.DataGridViewCellEventArgs'.
Yo suelo utilizar este tipo de acción para activar diversas lineas de código y nunca he tenido problema. ¿Por que este caso es distinto?
Agradezco cualquier sujerencia.
Gracias y un saludo
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
35
Private Sub Dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv.CellClick
Dim row As DataGridViewRow
row = dgv.Rows(e.RowIndex)
Using Frm2 As New frmCaldera
Frm2._IdCalde = CInt(row.Cells(0).Value)
Frm2._IdClien = CInt(row.Cells(1).Value)
Frm2._Nombre = CStr(row.Cells(2).Value)
Frm2._Factura = CStr(row.Cells(3).Value)
Frm2._Marca = CStr(row.Cells(4).Value)
Frm2._Tipo = CStr(row.Cells(5).Value)
Frm2._Instalacion = CStr(row.Cells(6).Value)
Frm2._Garantia = CStr(row.Cells(7).Value)
Frm2._VtoGarantia = CStr(row.Cells(8).Value)
Frm2._ImporCaldera = CDec(row.Cells(9).Value)
Frm2._miIva = CInt(row.Cells(10).Value)
Frm2._Total = CDec(row.Cells(11).Value)
End Using
End Sub
Sub cargaTexto()
Using Frm2 As New frmCaldera
txtIdCalde.Text = Frm2._IdCalde
txtIdClien.Text = Frm2._IdClien
txtNombre.Text = Frm2._Nombre
txtFactura.Text = Frm2._Factura
txtMarca.Text = Frm2._Marca
txtTipo.Text = Frm2._Tipo
txtInstalacion.Text = Frm2._Instalacion
txtGarantia.Text = Frm2._Garantia
txtVtoGarantia.Text = Frm2._VtoGarantia
txtImporCaldera.Text = Frm2._ImporCaldera
txtIva.Text = Frm2._miIva
txtTotal.Text = Frm2._Total
End Using
End Sub
Y trato de ejecutarlo con
1
2
Dgv_CellClick(sender, e)
cargaTexto()
y me muestra este error
Message --- No se puede convertir un objeto de tipo 'System.EventArgs' al tipo 'System.Windows.Forms.DataGridViewCellEventArgs'.
Yo suelo utilizar este tipo de acción para activar diversas lineas de código y nunca he tenido problema. ¿Por que este caso es distinto?
Agradezco cualquier sujerencia.
Gracias y un saludo
Valora esta pregunta


0