Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filling a Grid Dynamically
Message
From
26/10/2007 08:11:36
 
 
To
26/10/2007 06:57:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01263991
Message ID:
01264017
Views:
12
>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.

An example will best descibe how:
With Thisform
  .LockScreen		= .T.
  .nOrderNum		= 0
  With .pgfMainPageFrame
    With .Page3.grdRouteStops
      .FontSize		= 9
      .RecordSourceType	= 1	               && alias
      lcSetZoneCsr		= thisform.cSetZoneCsr  && Current cursor name stored in form property	
      .RecordSource	= ""
      .RecordSource	= ( lcSetZoneCsr)		
      .ColumnCount		= 6
      With .Columns(1)
        .FontBold		= .T.
        .ControlSource	= "NUM"
        .Header1.Caption	= "No."
        .Header1.FontBold	= .T.
        .Bound		= .T.
        .Width		= 33
        .Text1.Visible	= .T.
      EndWith		&& .Columns(1)
 
      With .Columns(2)
        .FontBold		= .T.
        .ControlSource		= "ZONE"
*       etc.
  EndWith
  .LockScreen		= .F.
EndWith  && Thisform    
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform