QUIERO HACER UN METODO QUE CONTROLE LA EDICION DE LAS COLUMNAS DE UN BROWSE
Publicado: Jue Ene 29, 2009 3:22 pm
PUDIERA SER DE ESTE TIPO
EL PROBLEMA ES QUE NO ME ENTRA EN EDICION DE LA PRIMERA COLUMNA .
ES DECIR CUANDO Nk VALE 1 NO EJECUTA :EDIT()
¿QUE HAGO MAL?
UN SALUDO Y GRACIAS
METHOD EditLinea(nLin)
local nK := 1
local aDatosLin := {}
nLin := ::oBrowse:nArrayAt
//--- Copio datos actuales
aDatosLin := ::oBrowse:GetRow()
//--- Bucle de Edicion -----
do while nK <= len(::oBrowse:aCols)
with object ::oBrowse:aCols[nK]
if :nEditType != beNONE
if :Edit()
//--- Controles
do case
case nK == 1 //Codigo
if :oGridEdit:Value == 0 .or. :oGridEdit:Value >
len(::aArtic)
MsgAlert("Codigo inexistente","!!! Atencion !!!")
loop
else
::aPrecios := ::aArtic[:oGridEdit:Value,3]
endif
case nK == 7
if :oGridEdit:Value == "N"
if MsgNoYes("Desea abandonar la edicion?","Por
favor...")
for nN := 1 to len(aDatosLin)
oSender:oParent:SetValue(nN,aDatosLin[nN])
//Recupero valores originales
next nN
else
nK := 1
loop
endif
endif
endcase
endif
endif
end with
::CalLinea(nLin)
nK ++
enddo
RETURN NIL
EL PROBLEMA ES QUE NO ME ENTRA EN EDICION DE LA PRIMERA COLUMNA .
ES DECIR CUANDO Nk VALE 1 NO EJECUTA :EDIT()
¿QUE HAGO MAL?
UN SALUDO Y GRACIAS
METHOD EditLinea(nLin)
local nK := 1
local aDatosLin := {}
nLin := ::oBrowse:nArrayAt
//--- Copio datos actuales
aDatosLin := ::oBrowse:GetRow()
//--- Bucle de Edicion -----
do while nK <= len(::oBrowse:aCols)
with object ::oBrowse:aCols[nK]
if :nEditType != beNONE
if :Edit()
//--- Controles
do case
case nK == 1 //Codigo
if :oGridEdit:Value == 0 .or. :oGridEdit:Value >
len(::aArtic)
MsgAlert("Codigo inexistente","!!! Atencion !!!")
loop
else
::aPrecios := ::aArtic[:oGridEdit:Value,3]
endif
case nK == 7
if :oGridEdit:Value == "N"
if MsgNoYes("Desea abandonar la edicion?","Por
favor...")
for nN := 1 to len(aDatosLin)
oSender:oParent:SetValue(nN,aDatosLin[nN])
//Recupero valores originales
next nN
else
nK := 1
loop
endif
endif
endcase
endif
endif
end with
::CalLinea(nLin)
nK ++
enddo
RETURN NIL