Keeping the position of scroll bar in a list

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
sotos
Posts: 17
Joined: Fri Feb 09, 2018 11:25 pm

Keeping the position of scroll bar in a list

Post by sotos » Thu Feb 07, 2019 6:59 pm

Hello everyone,

I have a browse list. Each row has a button and some other fields. Each time I press the button the specific row is deleted from the list,
the list refreshes and it shows again the 1st element. If I have many rows in the list each time I delete a row I have to scroll back to where I was before
in order to delete the next row and this is very tedious.

Is there any way to keep the scroll bar position after deleting the row?

cheers,
Sotiris

jyoung
Posts: 590
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Keeping the position of scroll bar in a list

Post by jyoung » Fri Feb 08, 2019 2:48 am

Not sure what you mean by a browse list, but if you are using a PRIM_LIST, you can use the VerticalScrollTo method.

https://docs.lansa.com/14/en/lansa016/p ... rollto.htm

Since you are deleting a row and refreshing the list, you may have to store an index or something so you can get the item close to the row that was deleted and use that entry to for the position.

Hope this helps,
Joe

sotos
Posts: 17
Joined: Fri Feb 09, 2018 11:25 pm

Re: Keeping the position of scroll bar in a list

Post by sotos » Fri Feb 08, 2019 9:06 pm

thanks,

that is exactly what I was looking for.

best,
Sotiris

Post Reply