Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing for header click in a grid
Message
De
29/07/2003 10:00:46
 
 
À
29/07/2003 09:39:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00814471
Message ID:
00814505
Vues:
13
Fernando, that's kind of what I thought. I don't think you can do it that way. You'll need to create your own header classe and add it to the column. Put your click code in the header you create.

Alan

>Hi Alan,
>
>>Where is this code? Is there a column19 when you create the grid?
>
>In order to be easier to reproduce the problem I'm having, I changed a bit the code (see below) and used a sample VFP 8 dbf. Also changed "column 19" to "column 1". Just paste the VFP code in a prg file and run it.
>
>Thanks!
>
> Close DataBases All
>
> Use Home () + "Samples\Data\employee.dbf" In 0  Alias MyRecordSource
>
> oGridTest = CreateObject ("frmGridTest")
>
> oGridTest.Show ()
>
> Clear Events
>
> Close DataBases All
>
>
> Define Class frmGridTest as cPtrForm
>*------ ----- ----------- -- --------
>
> Height  = 315
> Width   = 560
> Name    = "frmGridTest"
> Caption = " Grid Tests"
>
> Add Object grdTestGrid    as cPtrGrid    with Top              =   5             , ;
>                                               Left             =   5             , ;
>                                               Height           = 275             , ;
>                                               Width            = 550             , ;
>                                               RecordSourceType =   1             , ;
>                                               RecordSource     = "MyRecordSource"
>
> Add Object cmdCancel    as cPtrButton    with Top              = 285             , ;
>                                               Left             = 480             , ;
>                                               Cancel           = .T.             , ;
>                                               Caption          = "\<Close"
> Procedure cmdCancel.Click
>*          --------- -----
>           ThisForm.Release
> EndProc
>
>*Procedure grdTestGrid.Column1.Header.Click
>*          ----------- ------- ------ -----
>*          MessageBox ("grdTestGrid.Column1.Header1.Click")
>*EndProc
>
> Procedure QueryUnload
>*          -----------
>           ThisForm.cmdCancel.Click
>
>           NoDefault
>
>           Return .T.
> EndProc
>
> EndDefine
>
> Define Class cPtrGrid as Grid
>*------ ----- -------- -- ----
>
> Top                =   0
> Left               =   0
> Height             = 100
> Width              = 100
> RowHeight          =  17
> FontName           = "arial"
> FontSize           =   8
> GridLines          =   0
> DeleteMark         = .F.
> RecordMark         = .T.
> AllowCellSelection = .F.
> AllowAutoColumnFit =   0
> HighlightStyle     =   2
>
> HighlightForeColor = RGB (255, 255, 255)
> HighlightBackColor = RGB (  0,   0, 128)
>
> ReadOnly           = .T.
> Visible            = .T.
>
> EndDefine
>
> Define Class cPtrButton as CommandButton
>*------ ----- ---------- -- -------------
>
> Top                =  0
> Left               =  0
> Height             = 25
> Width              = 75
>
> Enabled            = .T.
> Visible            = .T.
> Style              =  0
> FontName           = "Arial"
> FontSize           =  8
>
> EndDefine
>
> Define Class cPtrForm as Form
>*------ ----- -------- -- ----
>
> AutoCenter         = .T.
> ShowWindow         =  0
> BorderStyle        =  2
> Enabled            = .T.
> AlWaysOnTop        = .F.
> WindowType         =  1
> ScaleMode          =  3
> FontName           = "Arial"
> FontSize           =  8
>
> EndDefine
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform