Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Grid behavior
Message
From
11/11/2003 12:51:49
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Strange Grid behavior
Miscellaneous
Thread ID:
00848797
Message ID:
00848797
Views:
46
Hi,

I'm experiencing a strange behavior when hiding columns of a grid (This.Column1.Visible = .F.). When I tab to navigate horizontally grid's columns it goes ok, the same happens when I click over the horizontal scroll bar. OTOH when I click over the right and left arrows of the horizontal bar the grid behaves oddly, misplacing headers and columns.

Please see code below (it is ready to be executed - DOed).

Is that a bug?

TIA,

Fernando
 Use "C:\Program Files\Microsoft Visual FoxPro 8\Samples\Data\orders.dbf" In 0  Alias MyRecordSource

 oGridTest = CreateObject ("frmGridTest")
 oGridTest.Show ()

 Clear Events

 Close DataBases All

 Define Class cPtrGridLB as Grid
*------ ----- ---------- -- ----

        Top                 =   0
        Left                =   0
        Height              = 100
        Width               = 100
        RowHeight           =  16
        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)

        RecordSourceType    =  1
        RecordSource        = "MyAliasName"

        ReadOnly            = .T.
        Visible             = .T.

 EndDefine

 Define Class frmGridTest as Form
*------ ----- ----------- -- ----

        Height     = 400
        Width      = 560
        Name       = "frmGridTest"
        Caption    = " What's happenning with this Grid?"

        WindowType =   1 
        Closable   =  .T.
        ControlBox =  .T.
        MaxButton  =  .F.
        MinButton  =  .F.
        Movable    =  .T.
        ZoomBox    =  .F.
        SizeBox    =  .F.
        AutoCenter =  .T.
        ShowWindow =   0 

*       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

        Add Object grdTestGrid    as cPtrGridLB  with Top               =   5               , ;
                                                      Left              =   5               , ;
                                                      Height            = 360               , ;
                                                      Width             = 550               , ;
                                                      RecordSourceType  =   1               , ;
                                                      RecordSource      = "MyRecordSource"

*       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

        Add Object cmdCancel    as CommandButton with Top               = 370               , ;
                                                      Left              = 480               , ;
                                                      Height            =  25               , ;
                                                      Width             =  75               , ;
                                                      FontName          =  "Arial"          , ;
                                                      FontSize          =   8               , ;
                                                      Cancel            = .T.               , ;
                                                      Caption           = "\<Close"

*       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

        Procedure cmdCancel.Click
*                 --------- -----
                  ThisForm.Release
        EndProc

        Procedure grdTestGrid.Init
*                 ----------- ----
                  This.Column1.Visible = .F.
                  This.Column2.Visible = .F.
                  This.Column3.Visible = .F.
                  This.Column4.Visible = .F.
        EndProc

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

 EndDefine
Next
Reply
Map
View

Click here to load this message in the networking platform