Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Class and custom header replacement error
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00817621
Message ID:
00817776
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
Any general purpose way to transfer properties from one to another or I have to use brute force methods to transfer design time properties at runtime?

modify your code as follows:
FOR EACH loColumn IN THIS.COLUMNS
  *** replace the header with custom header class
  *** created in code
  IF !EMPTY(THIS.cHeaderClass)
    SET PROCEDURE TO VSOClasses.prg ADDITIVE
    FOR EACH loObj IN loColumn.CONTROLS
      IF loObj.BASECLASS = 'Header'
        *** Save the changed properties
        lnProps = AMEMBERS( laProps, loObj, 0, 'C' )
        DIMENSION laVals[ lnProps ]
        FOR lnCnt = 1 TO lnProps
          laVals[ lnCnt ] = EVALUATE( 'loObj.' + laProps[ lnCnt ] )
        ENDFOR

	lcName = loObj.NAME
	loColumn.REMOVEOBJECT(lcName)
	loColumn.ADDOBJECT(lcName + "_new", THIS.cHeaderClass)

	loHeader = EVALUATE("loColumn." + ALLTRIM(lcName) + "_new")
        FOR lnCnt = 1 TO lnProps
          lcProp = 'loHeader.' + laProps[ lnCnt ]
          &lcProp = laVals[ lnCnt ]
        ENDFOR

	EXIT
      ENDIF
    ENDFOR
  ENDIF
  ...
  ...
ENDFOR
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform