Determining scroll position

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Determining scroll position

Post by jyoung »

Is there a way to determine what the scroll position of a list is?

Basically I have a unique case where when the user scrolls near the bottom of the list, I need to add more items to the list.

I've tapped into the ScrollChanged event, but cannot seem to get any useful information out of it.
I was hoping to find something that would tell me "the user has scrolled to 75% of the list".
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: Determining scroll position

Post by BrendanB »

If you use the ItemRealizing event, the items in the list are realized as they come into view.

you can then check #item.entry to see how close to the bottom of the list you are.

alternatively, you can use the scrollchanged event and check the location of the item (that is, the item which indicates 75% of the list has been shown) in relation to position of the list control. This would allow you to wait for that item to be 'halfway up' the list.

Reply if you need code.
Post Reply