Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filling a Grid Dynamically
Message
De
26/10/2007 14:11:56
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
26/10/2007 13:46:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01263991
Message ID:
01264257
Vues:
16
>>>>hi all,
>>>>
>>>>i am generating a cursor dynamically and need to populate a grid with the contents of the cursor. the number of columns in the cursor vary every time hence will the columns of the grid.
>>>>
>>>>how can i achieve this result ? and, i want to set the width of every column to some fixed width too - say 50 . how can i achieve this ? will a for...next loop accomplish the task ?
>>>>
>>>>finally, i need to change the font colour of certain values in the grid to RED if they fall short of a certain condition. how can i do this given that the column names of the grid can vary and are not constant every time ?
>>>>
>>>>hope i am understood.
>>>>
>>>>with sincere thanks.
>>
>>I'd just add one more line, just before setting the recordsource, so if the new cursor has more columns than the grid, it would get additional columns. Alternately, it could have exactly fcount() columns.
>>
>>>
>>>with myGrid
>>   .columncount=max(.columncount, fcount())
>>> .RecordSource = 'cursorname'
>>> * Column widths to 50
>>> .SetAll('Width',50)
>>> * Red based on condition - ie: a numeric field under 100
>>> .SetAll('DynamicBackColor', '(iif(cursorname.somefield < 100,0x0000FF,0xFFFFFF))')
>>>endwith
>>>
Cetin
>
>Oh right, I forgot to add:
>
> .columncount=-1
>
>;)

Actually I like that even better.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform