Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Customized Header in Grid
Message
From
11/01/2010 10:44:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01443157
Message ID:
01443235
Views:
60
This message has been marked as a message which has helped to the initial question of the thread.
>>>This one is for VFP7, but answers that require VFP9 are also welcome.
>>>
>>>Is there any way to ' replace' the headers in a grid in a form with a custom header? I'm not talking about code generated forms and grids. I'm tallking about the form designer where a grid is added and the number of columns is still unknown.
>>>
>>>(Brings me on an idea: Create a grid class that has 10 columns and each header got the same custom code. Setting columncount to a lower value later is just another way than making it higher than -1. But this scenario might become a nightmare scenario because any maintenance would require 10 equal modifications in 10 places.)
>>
>>Define the header in code, then in the grid's init take the old one out with RemoveObject() and add the new one with Addobject()?
>
>Interesting idea. Did you test it?

I did, even back in VFP7. I've found that the removeobject() is unnecessary, because a column must, at any time, have one and only one column. In the debugger, if you follow what's going on, you can see that as soon as you remove the header, it's replaced with a default header. But then, when you add a new header, the old one vanishes.

IMO, the easiest (and what I have in code somewhere)

save the caption and whatnot from the old header
add the new header
apply the saved properties
bindevent to the new header any behavior you need.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform