I have a "form" datawindow that users will enter scores into. It contains a single row with multiple entry columns on the form. When a user tabs to the next field I want to automatically scroll to that point. I have been trying any number of different approaches ( including using the VerticalScrollPosition/VerticalScrollMaximum) but without success. I have read the help files and maybe I am not fully understanding what it meant by "vertical scroll bar" and "scroll box" but trying to modify the verticalscrollposition is not doing what I expected. Thanks.
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- How to Scoll to a Column within a DataWindow That is Not Currently Visible
- Greg Duvall
- PowerBuilder
- Wednesday, 5 September 2018 15:00 PM UTC
- Thursday, 6 September 2018 15:26 PM UTC
- PowerBuilder
- # 1
Chris, I had found similar code and had been trying that. What did resolve it was the answer from Miguel Leeuwe. I turned off autosize height and the tabbing worked. Thanks for everyone's input on this. I can't tell you how much I appreciate it. If you ever make it to Saint Louis, MO, look me up and we'll throw a few back! Thanks again.
- Miguel Leeuwe
- Thursday, 6 September 2018 15:32 PM UTC
-
Helpful Loading... Helpful 0
- Thursday, 6 September 2018 15:06 PM UTC
- PowerBuilder
- # 3
I've done something similar (very large dw detail height).
When I check the autosize height it stops auto-scrolling, please try to see if it works when you un-check the autosize height for the detail band. On my example it then works.
(so this is without any coding).
- Thursday, 6 September 2018 14:44 PM UTC
- PowerBuilder
- # 4
The images are after the changes suggested by Chris were made.
- Thursday, 6 September 2018 14:38 PM UTC
- PowerBuilder
- # 5
The DW is a tabular form with a SQL backend that when printed, would create 2 pages. The detail band autosize height is checked and the detail height is around 16.5 inches (in the DW painter). Attached are three images. The first one is when the tabpage is selected, the second is after hitting the tab key for the first time and the final image is after hitting the tab key a second time. Please not the position of the scroll bar,
- Chris Pollach @Appeon
- Thursday, 6 September 2018 15:08 PM UTC
-
Helpful Loading... Helpful 0
- Thursday, 6 September 2018 13:58 PM UTC
- PowerBuilder
- # 6
Hi Greg;
Give this code a try in the ItemFocusChanged event ...
long ll_scroll
Int li_rc
String ls_describe
String ls_modify = "DataWindow.VerticalScrollPosition = '"
String ls_rc
String ls_column
ls_column = String (dwo.name)
ls_column += ".Y"
ls_rc = THIS.Describe( ls_column )
ll_scroll = Long ( ls_rc)
ls_modify += + String (ll_scroll ) + "'"
ls_rc = THIS.Modify ( ls_modify )
This should keep the DC scrolled to the current column at the top of the DC
HTH
Regards ... Chris
- Wednesday, 5 September 2018 23:50 PM UTC
- PowerBuilder
- # 8
Hi,
Maybe I don't understand completely what you mean with "automatically scroll to that point", but the scroll should be automatic.
Using powerbuilder 12.6, I've made a freeform external dw with 3 columns (A, B and C) and one row of fixed data.
Only the first 2 columns fit in the visible area of my dw control on a window.
when I tab, being in the second column, it automatically scrolls up.
I now see column B and C on the dw. (column A has scrolled up, out of the visible area).
Maybe you want to scroll to a specific different column ?
- Page :
- 1
However, you are not allowed to reply to this question.