FoxPro/Visual FoxPro - codigo q uso en grid

 
Vista:

codigo q uso en grid

Publicado por mario (90 intervenciones) el 30/01/2009 15:42:45
este es el codig que utilizo en el text del grid aver si alguien encuentra el problema por que yo no encuentro
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 13 &&enter
SELECT aux_ven
replace aux_ven.det_cant WITH 0
replace aux_ven.det_grav WITH 0
replace aux_ven.det_gravA WITH 0
replace aux_ven.det_exen WITH 0
STORE 0 TO ThisForm.txtexen.Value
STORE 0 TO ThisForm.txtgrav.Value
STORE 0 TO ThisForm.txtgravA.Value
STORE 0 TO totexen
STORE 0 TO totgrav
STORE 0 TO totgravA
STORE 0 TO ThisForm.txtdto.Value
STORE 0 TO ThisForm.txttot.Value
DO FORM _busprod01
ENDIF
**INGRESAR OTRO REGISTRO EN LA GRILLA
IF nKeyCode = 22 &&enter
SELECT aux_ven
APPEND BLANK
ENDIF
**BORRAR UN REGISTRO DE LA GRILLA
IF nKeyCode = 7 &&borrar
SELECT aux_ven
DELETE
SELECT facturadetalle
GO top
ThisForm.GRID11.setfocus
sum(aux_ven.det_exen) to totexen
sum(aux_ven.det_grav)to totgrav
sum(aux_ven.det_gravA)to totgravA
ThisForm.txtexen.Value = totexen
ThisForm.txtgrav.Value = totgrav
ThisForm.txtgrava.Value = totgrava
ThisForm.txttot.Value = ThisForm.txtexen.Value + ThisForm.txtgrav.Value + ThisForm.txtgrava.Value
mercodigo = facturadetalle.producto_cod_producto
thisform.GRID11.refresh
thisform.Refresh
ENDIF
****envia a cantidad para ser cargada*****
IF mivar = 1 then
thisform.GRID11.column4.SetFocus
thisform.GRID11.Refresh
ENDIF
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:codigo q uso en grid

Publicado por Saul (728 intervenciones) el 30/01/2009 17:22:41
Pues mira

Yo lo que basicamente hago en estos casos yo uso una tabla temporal.

y le agrego de una vez 25 lineas..
con algun F5 le agrego otras 25 lineas si fueran necesario pero cuando el
usuario dice grabar es alli donde subo mi informacion a mi tabla definitiva.

y no pongo las lineas que estan en blanco logicamente.

y con esto me evito de estar agregando cada vez que el usuario quiera sino que cuando le doy enter a mi ultima columna el lo unico que hace es darle skip y ponerle en la columna uno.

Suerte.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar