Link to home
Start Free TrialLog in
Avatar of dougr
dougr

asked on

Partial Horizontal Scrolling of MSFlexGrid

Is it possible to do horizontal scrolling on only a portion of the columns of a MSFlexgrid?

Suppose I create a MSFlexgrid which is 30 columns wide.  I make it so that only 10 columns can be displayed on the screen and the remainder can be scrolled right and left with a horizontal scroll bar.  So far so good.

Is there any way that I can control the scroll so that columns 0 to 4 stay in a fixed horizontal position and columns 5 to 29 are the only ones affected by the scroll bar - sort of like a Lotus spreadsheet with the first 5 columns fixed?

PLEASE NOTE: that I do not want to declare columns 0 to 4 as "fixed" columns in the usual sense.  I want to reserve this for column 0 only (with the usual light grey backgound color for the purpose of highlighting Row Titles etc.).

I still want to have columns 1 to 4 behave as normal FlexGrid columns where cells can be selected and highlighted by dragging focus rectangle with the mouse in the conventional manner.  Its just that I want to "FREEZE" them from scrolling horizontally.

The only solution I can think of is to have TWO FlexGrids side by side.  The first one will be 5 columns wide with NO scroll bar.  And the second one will be 25 columns wide WITH a scroll bar.  Then I must figure out how to link them together so that they are both controlled by the same VERTICAL scroll bar and they appear to the user to be just one FlexGrid.

dougr
ASKER CERTIFIED SOLUTION
Avatar of schild
schild

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dougr
dougr

ASKER

To: schild  

Thanks for the bad news and the code.

Actually either of the two FlexGrids can be scrolled (by vertical Scroll Bars, PgUp/Dn, ArrowUp/Dn keys etc.) so I put similar code in the Scroll event of both FlexGrids.

It seems to work ok, but it makes revisions, inserts, deletes and updates quite a bit more complex as I must write code for both grids.  Oh well, C'est la vie!

dougr
Avatar of dougr

ASKER

To: schild  

Thanks for the bad news and the code.

Actually either of the two FlexGrids can be scrolled (by vertical Scroll Bars, PgUp/Dn, ArrowUp/Dn keys etc.) so I put similar code in the Scroll event of both FlexGrids.

It seems to work ok, but it makes revisions, inserts, deletes and updates quite a bit more complex as I must write code for both grids.  Oh well, C'est la vie!

dougr