LOCAL llHeightOkay, lnI, loErr, lnOrignalHeight IF (NOT EMPTY(THIS.nRequiredHeight)) OR THIS.HEIGHT < 50 *** 24/06/2009 set the nMinHeight based on the valid grid height *** this in conjunction with Height_Assign() *** to avoid height is illegal value error lnOrignalHeight = THIS.HEIGHT llHeightOkay = .T. FOR lnI = 50 TO 1 STEP -1 llHeightOkay = .F. *** go through each height possibilities TRY *** have to do this as there is an _assign that triggers THIS.nMinHeight = lnI THIS.HEIGHT = lnI CATCH TO loErr IF loErr.ERRORNO = 1881 && Error with grdFooter - Height : Expression evaluated to an illegal value. *** we found the minimum height -1 because it errored llHeightOkay = .T. ELSE *** some other error it's parents turn to handle it THROW ENDIF ENDTRY IF llHeightOkay *** we found a height that is valid so exit THIS.nMinHeight = THIS.HEIGHT EXIT ENDIF ENDFOR *** try to give back the original height to the grid else the minimum height possible THIS.HEIGHT = MAX(lnOrignalHeight, THIS.nMinHeight) *** if you have filled in a nRequiredHeight we try to set that rather than the design time one IF NOT EMPTY(THIS.nRequiredHeight) THIS.HEIGHT = MAX(THIS.nRequiredHeight, THIS.nMinHeight) ENDIF ENDIF RETURN DODEFAULT()GridBaseClass.Height_Assign
LPARAMETERS vNewVal *** 23/06/2009 in conjunction with the code in Init() *** to avoid height is illegal value error THIS.HEIGHT = MAX(THIS.nMinHeight, m.vNewVal, THIS.HEADERHEIGHT)