Dragan
>Are you sure you still have the old header when you add the new one?
I have experienced the disappearance of the old header as soon as new one is added - there can be only one. Did this change in VFP8? I know in VFP7 (and older) the old header vanished immediately, as soon as new one was added. For other controls in a column, yes, you can have as many as you want, but header seemed to be special.
You are right. It looks like my tested statement was wrong. I've mixed two solutions. After a closer look to my grid I saw that I remove first. ::(
So the properties need to be stored to some temporary place like an array before NEWOBJECT. This should do the trick.
with myForm.myGrid.Colum1
LOCAL ARRAY;
laHeaderProps(2,1)
laHeaderProps(1,1)= .Header1.Caption
laHeaderProps(2,1)= .Header1.FONTBOLD
.REMOVEOBJECT('Header1')
.NEWOBJECT('Header2',"MyHeader","MyClass.prg")
.Header2.name = 'Header1'
.Header1.Caption = laHeaderProps(1,1)
.Header1.FONTBOLD = laHeaderProps(2,1)
wait .header1.class
endwith
Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]