Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grids: anybody tried custom columns class?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00840600
Message ID:
00840920
Vues:
53
Marc,

I've not tried this, but if in the designer you set the MemberClass property VFP warns you that it's going to destruct the grid and you'll lose all the column property settings. The column properties are all set in the grid's row in the VCX in the Properties memo.

This worked for me just now.

BACKUP everything first I'm not responsible if your stuff all gets blown away by this *g*

edit your grid class and make sure every column has an explicitly overridden Name property. If you don't do this you'll have to edit the Parent property of the headers and controls inside the column.

close the class designer.

use theClasslib.vcx
browse for baseclass = "grid"

add these lines at the top of the properties memo:
MemberClassLibrary = mycolumn.prg
MemberClass = "myColumn"
using your correct class and prg name...

edit the lines like
Column1.Movable = .F.
Column1.Name = "Column1"
Column2.Width = 25
Column2.Name = "Column2"
Column3.Name = "Column3"
to
myColumn1.Movable = .F.
myColumn1.Name = "Column1"
myColumn2.Width = 25
myColumn2.Name = "Column2"
myColumn3.Name = "Column3"
do not add any extra blank lines to the memo.

USE
compile classlib theClasslib

then you should be able to open the grid in the designer and it'll have your custom Column class with all the properties intact.

>... and are we supposed to re-design all our existing grids if we want to implement it?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform