Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ColumnOrder Property Help File Example
Message
From
01/08/2003 07:42:30
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Product Documentation
Title:
ColumnOrder Property Help File Example
Miscellaneous
Thread ID:
00815797
Message ID:
00815797
Views:
58
Hi,

In the ColumnOrder Property example in VFP 8 Help file, you can read (in Remarks):

"If a Grid contains five columns and you want the third column displayed last, set the ColumnOrder property of the third column to 5. The ColumnOrder setting for the fourth column becomes 3, the ColumnOrder setting for the fifth column becomes 4, and so on."

In the example below I tried to reproduce that situation, but what I got was column 3 and 5 swaping positions and the other columns positions remaining unchanged, so the final order became: 1, 2, 5, 4, 3.

What the help file states for the column order is: 1, 2, 4, 5, 3.

Am I interpreting incorrectly that explanation, or it is incorrect?

Regards,

Fernando

PS. If you want to reproduce the test, just copy the VFP code sequence below, paste it in a .prg file and run.
 Close DataBases All

 Create Cursor CurExample (C1 C (10), ;
                           C2 C (10), ;
                           C3 C (10), ;
                           C4 C (10), ;
                           C5 C (10))

 Insert Into   CurExample Values ("Column 1", ;
                                  "Column 2", ;
                                  "Column 3", ;
                                  "Column 4", ;
                                  "Column 5")
 Select CurExample
 
 oGridTest = CreateObject ("frmGridTest")

 oGridTest.Show ()

 Clear Events

 Close DataBases All

 Define Class frmGridTest as cPtrForm
*------ ----- ----------- -- --------

 Height  = 150
 Width   = 400
 Name    = "frmGridTest"
 Caption = " ColumnOrder Property Help Example"

 Add Object grdTestGrid as cPtrGridLB with Top              =   5, ;
                                           Left             =   5, ;
                                           Height           = 110, ;
                                           Width            = 390, ;
                                           RecordSourceType =   1, ;
                                           RecordSource     = "CurExample"

 Add Object cmdCancel   as cPtrButton with Top              = 120, ;
                                           Left             = 320, ;
                                           Cancel           = .T., ;
                                           Caption          = "\<Close"
 Procedure cmdCancel.Click
*          --------- -----
           ThisForm.Release
 EndProc

 Procedure grdTestGrid.Init
*          ----------- ----
           This.Column3.ColumnOrder       = 5

           This.Column3.Header1.ForeColor = Rgb (255, 0, 0)
           This.Column5.Header1.ForeColor = Rgb (255, 0, 0)

  MessageBox ("This.Column1.ColumnOrder: " + Str (This.Column1.ColumnOrder) + Chr (13) + ;
              "This.Column2.ColumnOrder: " + Str (This.Column2.ColumnOrder) + Chr (13) + ;
              "This.Column3.ColumnOrder: " + Str (This.Column3.ColumnOrder) + Chr (13) + ;
              "This.Column4.ColumnOrder: " + Str (This.Column4.ColumnOrder) + Chr (13) + ;
              "This.Column5.ColumnOrder: " + Str (This.Column5.ColumnOrder))
 EndProc

 Procedure QueryUnload
*          -----------
           ThisForm.cmdCancel.Click
           NoDefault
           Return .T.
 EndProc

 EndDefine

 Define Class cPtrForm as Form

        AutoCenter         = .T.
        ShowWindow         =  0 
        BorderStyle        =  2 
        Enabled            = .T.
        WindowType         =  1 
        ScaleMode          =  3 
        FontName           = "Arial"
        FontSize           =  8

 EndDefine

 Define Class cPtrGridLB as Grid

        RowHeight          =  17
        FontName           = "arial"
        FontSize           =  8
        GridLines          =  0
        GridLineColor      = Rgb (192,192,192)
        DeleteMark         = .F.
        RecordMark         = .F.
        SplitBar           = .F.

        AllowAutoColumnFit =  0
        AllowHeaderSizing  = .F.
        AllowRowSizing     = .F.
        AllowCellSelection = .F.

        HighlightStyle     =  2
        HighlightForeColor = Rgb (  0,   0,   0)
        HighlightBackColor = Rgb (165, 210, 255)

        ReadOnly           = .T.
        Visible            = .T.

 EndDefine

 Define Class cPtrButton as CommandButton

        Height             =  25
        Width              =  75
        Enabled            =  .T.
        Visible            =  .T.
        Style              =   0
        FontName           =  "Arial"
        FontSize           =   8

 EndDefine
Next
Reply
Map
View

Click here to load this message in the networking platform