Forum: wxRuby keeping columns in view in a grid

721c8d798f22f4e238afcd311607bfde?d=identicon&s=25 Will Parsons (Guest)
on 2011-06-02 02:57
(Received via mailing list)
I'm writing an application using wxruby in which the main portion is
essentially a spreadsheet using a Grid widget.  The extent of the Grid
is
such that it exceeds the available space that can be seen at once, so it
will be necessary to use scrollbars to see data as necessary.  However,
the
first two columns should stay in view even when the Grid is scrolled
horizontally.  (They contain names and ID numbers, so it would be
confusing
to have them go out of view when the grid is scrolled to the right.)
Does
anyone have suggestions on how to accomplish this?
Bfa670ef2303deb7dec5a8027367b30b?d=identicon&s=25 David Mullet (mully)
on 2011-06-04 16:57
Will Parsons wrote in post #1002674:
> I'm writing an application using wxruby in which the main portion is
> essentially a spreadsheet using a Grid widget.  The extent of the Grid
> is
> such that it exceeds the available space that can be seen at once, so it
> will be necessary to use scrollbars to see data as necessary.  However,
> the
> first two columns should stay in view even when the Grid is scrolled
> horizontally.  (They contain names and ID numbers, so it would be
> confusing
> to have them go out of view when the grid is scrolled to the right.)
> Does
> anyone have suggestions on how to accomplish this?

I'm not sure that the wxGrid control supports the ability to "freeze"
columns.

If not, you could perhaps use 2 grids, side by side, with the left grid
displaying the first two columns of your data and the right grid
displaying the remaining columns. You'd need, of course, to keep them in
sync as you scroll down through the rows.

David

http://rubyonwindows.blogspot.com
2d352e436babbf3d80d4a6171220cd5b?d=identicon&s=25 Chloro Form (tony44)
on 2011-06-07 17:05
the easiest way to accomplish this is to merge your two columns into one
and put them into the row label. It might not be what you're looking for
but it's definitely less effort than syncing two grids.

T
This topic is locked and can not be replied to.