Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Freeze a column in a grid
Message
From
01/07/2003 06:41:41
 
 
To
01/07/2003 02:50:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00805585
Message ID:
00805626
Views:
29
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
Previous
Reply
Map
View

Click here to load this message in the networking platform