Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding procedures at runtime for grid objects

Grids

Adding procedures at runtime for grid objects

by  Mike Gagnon  Posted    (Edited  )
Code:
CREATE CURSOR myCursor (name c(20),lname c(20),fname c(20))
oForm = CREATEOBJECT("form")
oForm.addobject("Grid2","GRID1")
for each oColumn in oform.grid2.columns
    oColumn.addobject("myheader1","_myheader")
endfor
oForm.show(1)
DEFINE CLASS grid1 as Grid 
    COLUMNCOUNT = 3
    VISIBLE = .T.
    recordsource = "mycursor"
ENDDEFINE
define class _myheader as header
    procedure click
        wait window TRANSFORM(this.parent.name)+" was clicked" nowait
    endproc
enddefine

Mike Gagnon
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top