How to scroll manually in FMXTableView?

Hello!


I tried to manually scroll in the FMXTableView component.
In a normal ListView I do it via
ListView.ScrollViewPos := value;

How does it work in FMXTableView?

Thanks,
   Werner

Hi, 


Scroll is based on items, to scroll to a specific item you can use the LookupItem method:

TMSFMXTableView1.LookupItem();

Pieter Scheldeman2016-10-24 15:55:18

Hi,
but how do I know which ist the actual first visible item in the listview?
So how can I scroll to the next page?
Scroll down: 1st visible element + 10
Scroll up: 1st visible element - 10

/Werner

Hi, 


This is currently not possible.
We have added a GetFirstVisibleItem and GetLastVisibleItem that will be available in the next release.

Hello!

I installed new version with new functions.
But still - how can I scroll?

Scroll up (is possible):
TopItem := myTableView.GetLastVisibleItem;

Scroll up (NOT POSSIBLE):
"LastVisibleItem" or "BottomItem" := GetFirstVisibleItem;

/Werner

You need to use TMSFMXTableView1.LookupItem as already mentioned in the previous posts

Hello!

Sure - but you cannot calculate the item to which you want to navigate! :)
My items are grouped. so not possible to calculate the "new topitem"!

Example:
TopItem/GetFirstVisibleItem = 50
GetLastVisibleItem = 70

Scroll Down - ONCE
-> set TopItem := 70
TopItem/GetFirstVisibleItem = 70
GetLastVisibleItem = 85

Scroll up again:
LoopupItem(???????)

/Werner

It's unclear what you want to achieve exactly? The TTMSFMXTableView is not designed to manage pages. The tableview loads items in a buffer, which can vary, so you cannot know exactly which item will be at which position. If you want to build the TTMSFMXTableView up in pages you need to mark each item that needs to be displayed on Top as a page, you can use one of the Data* for this. Then you can get the first visible item, retrieve the page index and search for item on the next or previous page and set this item as top item with the LookupItem method.
Pieter Scheldeman2016-11-10 11:06:06

Hello!

But in last version is was implemented GetFirstVisibleItem and GetLastVisibleItem based on my scrolling request. But when I cannot set this values this brings not really the value.
In other components you can at least set the ScrollViewPos value.
But in this component I am not able to scroll at all - manually.
Specially in Point of Sale solution (which I develop) you cannot use mouse, keyboard or "modern" touch screen. They use touch buttons onscreen to navigate.
I already move many objects from TTMSFMXTableView to TListView - but for one object I still need it and have this scolling issue.
There are so many properties and functions in the component but not the simple scrolling.. :)
Just wondering.

Now I have it implemented like this:
ScrollUp -> TopItem := 0
So user has to scroll always from the top down... :/
Some kind of workarround... :D

Thanks for you support,
   Werner

Hi, 


We have additionally added a BottomItem property, as well as the ability to Scroll to a specific Position with the ScrollPosition property and have added a new parameter to the LookupItem procedure to allow scrolling to an item positioned on Top or Bottom. The next version will address this.

Great! :)
Thanks a lot!