genexusgenexus-sd

How to load a SD Grid and scroll automatically to last record on Genexus 15?


I have a SD grid to show messages received from other users (a simple chat app) and every time I open this panel, the first records appears and I have to manually scroll to reach last message.

Is there a way to automatically go to last record on this grid ?

I know there is a Select() method on grids, but this can´t be used on Refresh Event, only on user events.

I´m using GX15 U6

Thanks, Rogelio Arosemena


Solution

  • Yes, it is possible with Inverse Loading property

    This property is available for grids in the Smart Devices generator.

    By setting it to True (its default value is False), the developer will be able to load the grid in reverse direction (i.e. the Common Grid will be loaded from bottom to top, and the Horizontal Grid will be loaded from right to left).

    Example of use The canonical use case of inverse loading on a grid is that of a chat messaging system. What are its characteristics? It is loaded from bottom to top, pagination is performed with a swipe-down gesture, and when the user refreshes it the first page will be displayed in the lower section.