PowerBuilder Synchronized DataWindow Scrolling Not Working Properly
Posted on 2010-09-23
I am working on a pair of datawindows that are visible on a window. The upper datawindow has a scroll bar, while the bottom datawindow does not. Both datawindows are using the same datawindow dataobject. The datawindow being used has a header band, detail band, and summary band. NOTE: The upper and lower datawindows are sized just large enough on the window for only one row to be displayed for each click on the scroll bar.
When retrieve occurs, both datawindows are populated. If you click on the scroll bar of the upper datawindow to scroll down, the bottom datawindow scrolls in synchronization with the upper datawindow until you reach the bottom of the upper datawindow. At this point, the upper datawindow is displaying the summary band yet the bottom datawindow is displaying the last row in the detail band.
Here is the code in the ScrollVertical Event of the upper datawindow:
dw_lower.Object.datawindow.verticalscrollposition = scrollpos
The code above actually replaces code that was in place when the application was developed using PB version 5. The scrolling worked fine when it was version 5. When the application was migrated to PB 12, I replaced the script with the code above thinking it would resolve the problem. The problem still exists.
According to PB documentation, a ScrollToRow(lastrow) where lastrow is the number of detail rows + 1 should cause the summary band to be displayed but it doesn't. Just the last row in the detail band is displayed.
Any assistance would be greatly appreciated.