Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid classes and Header method code
Message
From
03/12/1999 12:11:13
 
 
To
03/12/1999 04:35:13
Sam Trenchard
System Support Services
London, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00297240
Message ID:
00298405
Views:
37
Hi Sam.

I see that Cetin has already jumped in to answer most of your questions. (Thanks a lot Cetin < s > ! )

>> I you write the code todefine a column class how do you instantiate it at run time within a grid ? <<

With code something like this in the grid's init. Just be aware that when you replace the base class columns with your custom column class, you must save and restore any property settings (like control sources) because you will lose them. Also, if you have any embedded custom classes (like custom headers and/or custom text boxes) you will lose them too. Personally, I think that a custom column class is more trouble than it is worth, but here is partial code to replace vfp's base class columns with your custom columns at runtime.
WITH This
   lnColumnCount = .ColumnCount
   FOR lnCol = 1 TO lnColumnCount
      *** Code here to save things like header captions
      *** and Column ControlSources 
      .RemoveObject( .Columns[1].Name )
   ENDFOR
   FOR lnCol = 1 TO lnColumnCount   
      .AddObject( 'Column'+ALLTRIM( STR( lnCol ) ), 'ColBase' )
      *** Code here to set the control source, etc. of the newly added column
   ENDFOR
ENDWITH
DODEFAULT()
Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform