Forum: wxRuby keeping columns in view in a grid

Posted by 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?
Posted by 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
Posted by 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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.