Hi all,
I am having a problem with changing a grid-header. Until now I did it just the way it is described in FAQ 7967 and the grid is part of a regular form.
Now I have put this form into a class and fox says 'Header1 cannot be created'. It seems, that the original Header1 is not removed correctly anymore.
What's wrong?
This is the code I am using:
* code of grid1.init
with this
for liZaehler = 1 to .columncount
for liZaehlHilf = 1 to .columns(liZaehler).controlcount
if inlist(lower(.columns(liZaehler).controls(liZaehlHilf).class),'header','cheader')
lcCaption = .columns(liZaehler).controls(liZaehlHilf).caption
lcHeaderName = alltrim(.columns(liZaehler).controls(liZaehlHilf).name)
endif
endfor
if pemstatus(.columns(liZaehler),lcHeaderName,5)
.columns(liZaehler).removeobject(lcHeaderName)
.columns(liZaehler).addobject(lcHeaderName,'cHeader')
.columns(liZaehler).&lcHeaderName..caption = lcCaption
.columns(liZaehler).&lcHeaderName..name = lcHeaderName
endif
endfor
endwith
* code of m_class.prg used with 'set procedure to m_class additive'
define class cheader as header
name = 'cHeader'
proc DblClick
this.parent.parent.header_click(this)
endproc
proc RightClick
this.parent.parent.header_rightclick(this)
endproc
ENDDEFINE
Best Regards
-Tom
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011