Upon page load, a ListSource variable is initialized with the fetch result from an entity that returns a ListSource. This variable is then assigned to the 'Data source' field of an Edit Grid Control.
Despite having the row display set to 25 and a total of 73 records, navigating between pages consistently shows the same 25 rows. It has been confirmed that the ListSource variable does contain the complete and correct dataset.
For Edit grid control, it is recommend using directly with Entity in Query builder (Fetch function), so that it will support server side pagination, sorting etc.
Because app variable holds a static copy of entity data, you will not be able to use server side pagination, sorting.
With App variable, we do not support all EG features like pagination, sorting out of the box.
However, it can be achieved with this LINQ function:
Example:
new ListSource(of Calendar)(sourceCal.data.Skip(MainPage.EditGrid.PageStart).take(MainPage.EditGrid.PageLimit), sourceCal.data.Count)
Components Explained
-
ListSource(of Calendar)This defines a newListSourceobject that holds a list ofCalendaritems.ListSourceis a special type used in UiPath Apps to bind data to controls like Edit Grids. -
sourceCal.dataThis is the full list of calendar data retrieved from a data source (likely an entity or API call). -
.Skip(MainPage.EditGrid.PageStart)This skips a number of records from the beginning of the list.PageStartis typically calculated based on the current page number and page size (e.g., page 2 with 25 rows would skip 25 items). -
.Take(MainPage.EditGrid.PageLimit)This takes a limited number of records after skipping.PageLimitis usually the number of rows to display per page (e.g., 25). -
sourceCal.data.CountThis provides the total number of records in the full dataset, which is needed for pagination controls to know how many pages exist.