Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Freeze a column in a grid
Message
De
01/07/2003 06:41:41
 
 
À
01/07/2003 02:50:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00805585
Message ID:
00805626
Vues:
28
May I know how to freeze a column in a grid.

In addition to what Cetin has said, if you want to lock only a single column, this code will do it for you:

Put this in the Init():
WITH This
  *** Find out which column is the leftmost column
  *** when the grid is instantiated and save it
  FOR lnCol = 1 TO .ColumnCount
    IF .Columns[ lncol ].ColumnOrder = 1
      .nFirstColumn = lnCol
      EXIT
    ENDIF
  ENDFOR
ENDWITH
This code in the Scrolled Method:
WITH This
  *** if we scrolled horizontally, adjust the column order
  *** so the leftmost column stays the leftmost column
  IF nDirection > 3
    .Columns( .nFirstColumn ).ColumnOrder = .LeftColumn
  ENDIF
ENDWITH
And this in AfterRowColChange:
WITH This
  *** if we scrolled horizontally, adjust the column order
  *** so the leftmost column stays the leftmost column
  IF .RowColChange > 1
    .Columns( .nFirstColumn ).ColumnOrder = .LeftColumn
  ENDIF
ENDWITH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform