saludos amigos
Porque pasara que a veces los eventos se repiten aunque no tengan que
hacerlo para nadase que no es un caso que solamente me pase a mi incluso
e visto codigo de ejemplo en internet sobre uso de variables para controlar
este problema anexo un ejmplo que he visto con esta clase de solucion
Reinout (IS/IT--Manageme) Dec 30, 2004
Problem was solved as soon as I added this code to all datagrids on
the page. Don't ask me why, but it works now :)
I'll paste the whole sub for those interested :
Private Sub myDatagrid_Leave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles myDatagrid.Leave
If controlDatagrid Then
myDatagrid.EndEdit(Nothing, myDatagrid.CurrentRowIndex,
False)
myDatagrid.BindingContext(myDatagrid.DataSource,
myDatagrid.DataMember).EndCurrentEdit()
Call UpdateDatabase()
controlDatagrid = False
Else
controlDatagrid = True
End If
End Sub
I insert a boolean because he tends to go through the sub twice, first
trying to leave the datagrid, but the update sub keeps the focus on the
datagrid, the second time the event is called I don't want to look for
possible changes, so I added the "controlDatagrid = false" to the first
part, I put it back on true in case I enter and leave the datagrid again.
Leer las respuestas