Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unexpected Behavior Adding Grid Columns as Listed in Tab
Message
 
À
24/07/2000 14:51:45
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00396007
Message ID:
00396358
Vues:
14
Hi Cindy

Had hell of a day! But it was not VFP that made it such a stress. <g>

I noticed you got already help, that's fine. (BTW I really didn't know
that raising ColumnCount adds a new Column during runtime. You'll never
stop learning <bg>)

Basing on your original approach I figured out the following that should
work too:

LOCAL lnOldSelect, lnKounter, lcControlSource, lnKounter
*
lnOldSelect = SELECT()
SELECT GridColumns
GO TOP
lnKounter = 1
WITH
SCAN FOR .T.

*
lnKounter= MAX(1, MIN(GridColumns.ColumnNo,.ColumnCount+1))

* This will hold lnKounter inside reasonable range,
* when your table should be disordered.

.ADDCOLUMN(lnKounter) && Becomes Columns(lnKounter)
.COLUMNS(lnKounter).Header1.CAPTION = GridColumns.ColumnName
.COLUMNS(lnKounter).READONLY = .T.

lcControlSource = pcTableName + [.] + ALLT(GridColumns.GridColumn)
.COLUMNS(lnKounter).CONTROLSOURCE = (lcControlSource)
ENDSCAN
ENDWITH
SELECT (lnOldSelect)


Regards
Markus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform