Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fix one colum in a Grid
Message
De
28/10/1999 05:47:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00282127
Message ID:
00282864
Vues:
25
>Cetin, do you know a way to do this programmatically vs. user manually splitting it? I don't think you can but...
>
>You could split the grid (SplitBar property or Splitter bar on bottom left corner of grid), then you could force to show columns starting from 2nd on the right panel using ActivateCell and Doscroll methods. You could even force to stay on right panel using setfocus or nodefault in BRCC.
>>Cetin
>



Hi John,
Is this pessimistic buffering or are you testing me :)
If you let me assume SplitBar property is .t. (ReadOnly at runtime) I could do it ( wish counted me as a correct answer in MCP exam :)
* Grid.Init
With this
  lnVertScrollWidth = iif(.ScrollBars < 2, 0, sysmetric(5) )
  lnRecAndDelMarkWidth = ( iif(.DeleteMark,0.6,0) + ;
    iif(.RecordMark,0.6,0) ) * lnVertScrollWidth
  lnGridLineWidth = iif(.GridLines < 2, 0, .GridLineWidth )
  .AddProperty("lInPanelChange")
  .Partition = .Columns(1).Width + ;
    lnVertScrollWidth + ;
    lnRecAndDelMarkWidth + ;
    lnGridLineWidth

  .ActivateCell(1,2) && Setfocus to 2nd col
  .DoScroll(7)    && Scroll page right
Endwith

* Grid.BRCC
Lparameters nColIndex
With this
  If .Panel = 0 and !.lInPanelChange
    .Panel = 1
  Endif
  If  .Panel = 1 and ( ;
      ( nColIndex=.ColumnCount and lastkey() = 9 ) ;
      or ;
      ( nColIndex=2 and lastkey() = 15 ) )
    .Panel = 0
  Endif
Endwith

*Grid.ARCC
Lparameters nColIndex
With this
  If .Panel = 0
    .lInPanelChange = .t.
    .Panel = 1
    .Columns(2).SetFocus()
    .Panel = 0
    .Columns(1).SetFocus()
    .lInPanelChange = .f.
  Endif
Endwith
This is VFP6 code. If VFP3-5 then you should add lInChangePanel property to grid or form or use a memvar instead. This could be enhanced to be dynamic and get locked column count from a property. Also I just wrote it for a standart grid where ColumnOrders are not tampered with ( and would bomb to work properly as soon as you move columns manually - because there are hardcoded columns() there ) . Enhancing it "is left to the user" :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform