Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different behaviour of VFP by changing gridheader in form
Message
From
26/02/2003 09:57:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Different behaviour of VFP by changing gridheader in form
Miscellaneous
Thread ID:
00758071
Message ID:
00758071
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform