Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid classes and Header method code
Message
De
03/12/1999 12:11:13
 
 
À
03/12/1999 04:35:13
Sam Trenchard
System Support Services
London, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00297240
Message ID:
00298405
Vues:
35
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform