>Can any one tell me how to freeze one or more columns
>on the left side in a grid table ?
Here is a Freeze Grid Coding which can be d/l at File section.
You need to Add a
New Form Property: BLOCKSCROLL from menu bar.
LPARAMETERS nColIndex
THIS.SCROLLED
LPARAMETERS nDirection
IF thisform.blockscroll=.t.
RETURN
ENDIF
thisform.blockscroll=.t.
DO case
CASE this.column1.columnorder=this.leftcolumn
CASE this.column1.columnorder<=this.leftcolumn-1
FOR n=this.column1.columnorder+1 to this.leftcolumn-1
this.column1.columnorder=n
ENDFOR
this.doscroll(4)
this.refresh
CASE this.column1.columnorder>this.leftcolumn
FOR n=this.column1.columnorder-1 to this.leftcolumn step -1
this.column1.columnorder=n
ENDFOR
this.column1.setfocus
ENDCASE
thisform.blockscroll=.f.
Well, I'd like to tell what BUG may happen:
If you got a Column which Column width > 1/3 of the whole grid,
you may
LOCK the right side column
when you Click the bottom rightmost [>] button to see the Next Column...
but you will work fine by type TAB inside grid cell.
If user Drag the non-1st column into column1 place...
All gone Crazy, (as For loop make the screen TOO many Refresh!) Flash~ Flash~ Flash~
What a suggest here as the first reply of this thread...
- split grid into 2 parts
- use code to Freeze "partition" of grid (Most likely at AfterRowColChange Event)
- Disable column1, So if user type tab within cell, it will loop to Column2 automatically.
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.