Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scroll to column

359 views
Skip to first unread message

M. Searer

unread,
May 29, 2008, 12:32:50 PM5/29/08
to
PB 11.1

for resizable grid datawindows:

I'm trying to figure out whether a column can be seen by the user based on its
horizontal location. The datawindow has a horiztonal scrollbar and I am setting
the current column with setcolumn(), but the column may not be viewable due to
the width of the datawindow object vs the datawindow control.

I only want to scroll (using HorizontalScrollPosition) to it if the user can not
see it.

If I know the width of the datawindow, then I can calculate it.
I thought I could use the control width (dw_1.width) and the
HorizontalScrollMaximum (assuming the datawindow is in PBunits or pixels with
conversion), but HorizontalScrollMaximum doesn't seem to be the width of the
datawindow object, just the calculated scrollbar size max.

I think i am stuck having to try and figure out the width of the datawindow
object via looking for the object with the max x + width value. Even if I do
that, then my calculations are dependent on the datawindow units being either PB
units or pixels?


Philip Salgannik

unread,
May 29, 2008, 1:31:50 PM5/29/08
to
Can you clarify in which circumstances you want to perform this "I only want
to scroll (using HorizontalScrollPosition) to it if the user can not see
it."?
I have a feeling that you are overengineering :-)

"M. Searer" <nos...@nospam.com> wrote in message
news:483edab2$1@forums-1-dub...

M. Searer

unread,
May 29, 2008, 1:45:43 PM5/29/08
to
the column is off to the right outside the current viewable area of the
datawindow control and is not visible unless the user scrolls over to the right.

I could just always scroll to the column regardless of whether it is already
visible, but then it will always move the position of the datawindow around on
the user. As a user, that would drive me nuts particularly since I might have
positioned the scroll location in order to see specific columns; but now the
system moved it on me.....


"Philip Salgannik" <PhilipS...@work.com> wrote in message
news:483ee886$1@forums-1-dub...

Philip Salgannik

unread,
May 29, 2008, 2:14:23 PM5/29/08
to
That does not answer my question.
WHEN is the column off to the right outside the current viewable area of the
datawindow control ?
WHEN do you decide to scroll for the user?

"M. Searer" <nos...@nospam.com> wrote in message
news:483eebc7$1@forums-1-dub...

M. Searer

unread,
May 29, 2008, 2:41:48 PM5/29/08
to
it is a grid datawindow - they can move columns around. And the column
location is saved off and restored each time the user opens that window.
So it can be at any time that the column of interest is outside the current
viewable area of the datawindow control.

During a full validation of the datawindow, if they have missing data I am
notifying them of the missing values and setting the column as current. But
that column may be outside the current viewable area. It is at that time that I
want to scroll.


"Philip Salgannik" <PhilipS...@work.com> wrote in message

news:483ef27f$1@forums-1-dub...

Philip Salgannik

unread,
May 29, 2008, 3:07:52 PM5/29/08
to
OK, so it's at validation time only. Then why bother with determination if
it's outside of visible area or not, if the column is in error (missing
data) just set HorizontalScrollPosition to the X coordinate of the column in
error and be done with it.

"M. Searer" <nos...@nospam.com> wrote in message

news:483ef8ec$1@forums-1-dub...

anuj...@gmail.com

unread,
Jun 2, 2008, 1:14:54 AM6/2/08
to
Even I want to use this feature.
I want to click on a cell for which I know the the Row Number and
Column Name.
Column of interest might not be in visible area. Does setting the
Horizontal scroll Position to the X value of the column works?

Philip Salgannik

unread,
Jun 2, 2008, 9:13:05 AM6/2/08
to
It absolutely does.
<anuj...@gmail.com> wrote in message
news:78ec71f4-bfa2-47fe...@q27g2000prf.googlegroups.com...

M. Searer

unread,
Jun 6, 2008, 3:50:59 PM6/6/08
to
FYI, I was able to get it to work - the values from HorizontalScrollMaximum
and window width did have what I needed.


"Philip Salgannik" <philema...@comcast.net> wrote in message
news:4843f1e1@forums-1-dub...

0 new messages