Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Header classes - please help!
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00422292
Message ID:
00422638
Views:
11
Hi, guys!

Did you know that we CANNOT remove header from grid at all? When you add new header to column, old header removed AUTOMATICALLY. VFP6 keeps always ONE and ONLY ONE header in column. So the correct code should be following:
FOR EACH loColumn IN This.Columns
     loColumn.AddObject("Hdr1","MyHeaderClass")
     loColumn.Hdr1.Name = "Header1"
ENDFOR
>>FOR EACH loColumn IN This.Columns
>> loColumn.RemoveObject("Header1")
>> loColumn.AddObject("Header1","MyHeaderClass")
>>ENDFOR
>>
>>I'm getting an error on the AddObject line-"Object name is invalid." If I use a different name, i.e. "HeaderA", it works. Why is this and how can I get around it? I really want to name the headers "Header1" because there are pieces of code that depend on the headers being named as such.
>
>I don't know WHY the error occurs, but I got it too. So, what I did was the following:
>FOR EACH loColumn IN This.Columns
>     loColumn.RemoveObject("Header1")
>     loColumn.AddObject("Hdr1","MyHeaderClass")
>     loColumn.Hdr1.Name = "Header1"
>ENDFOR
>All is well!
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform