Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Current left column to right of locked columns
Message
De
30/11/2008 14:42:01
 
 
À
30/11/2008 13:33:40
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01364611
Message ID:
01364730
Vues:
14
Tis true that when you have locked columns that columns can't be moved.

However, that doesn't mean that the columns weren't moved before the columns were locked.

My grid class allows users to add any column to the end of the locked columns, to move it to the end of all columns, and to remove locking of columns. The result is that there can be locked columns and the columns are not in their original order.

>>Cetin --
>>
>>Doesn't your example assume that the columns are still in their original order? I certainly would expect to see .ColumnOrder in there. I think that if your columns can move, you need to loop through all columns, essentially using .ColumnOrder instead of m.ix
>>
>>Jim
>
>Jim,
>AFAIK when columns locked VFP disables column moving. OTOH you are right I should do that from a safe coding point.
>
>Public oForm
>oForm = Createobject('SampleForm')
>oForm.Show()
>
>Procedure GetColumnOnLeft
>  Lparameters toGrid
>  Local ix
>  With toGrid
>    For ix = .LockColumns+1 To .ColumnCount
>      If Objtoclient(.Columns(m.ix),2) > 0
>        Return m.ix
>      Endif
>    Endfor
>  Endwith
>  Return -1
>Endproc
>
>Define Class sampleForm As Form
>  DataSession = 2
>  Height=400
>  Width=600
>  KeyPreview=.T.
>  Add Object myGrid As Grid With ;
>    Height=400,Width=600,Anchor=15,RecordSource='Customer'
>
>  Procedure Load
>    Set Multilocks On
>    Use (_samples+'data\customer')
>    * we don't want to save edits
>    * simply setting buffering and will never update
>    CursorSetProp("Buffering",5,'customer')
>  Endproc
>  Procedure Init
>    This.myGrid.LockColumns=2
>  Endproc
>  Procedure KeyPress
>    Lparameters nKey,nShift
>    If m.nKey = -4 And ;
>        TYPE('this.ActiveControl') = 'O' And ;
>        !Isnull(This.ActiveControl) And ;
>        this.ActiveControl=This.myGrid && F5 for this sample
>      Nodefault
>      Local lnIndex, oColumn
>      lnIndex = GetColumnOnLeft( Thisform.myGrid )
>      oColumn = Thisform.myGrid.Columns( m.lnIndex )
>      Wait Window ;
>        TEXTMERGE('<<oColumn.Header1.Caption>>'+;
>        ' - [<<oColumn.ControlSource>>]:'+;
>        '<<EVALUATE(oColumn.ControlSource)>>') Timeout 1
>    Endif
>  Endproc
>Enddefine
>
Cetin
Jim Nelson
Newbury Park, CA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform