i have a list and i want to know the index of first and last element in the mobile view
Hello Abduerhman,
Hope you are doing well.
The index of the first element is 0. You can easily access this element using the following statement:
GetYourListAggregate.List[0]
The index of the last element is length (of the list) minus 1. You can easily access this element using the following statement:
GetYourListAggregate.List[GetYourListAggregate.List.Length - 1]
Hope that this helps you!
Kind regards,
Rui Barradas
no i want last element in the view port of mobile not last element in the list
add expression to the list and give list .current.index value so you can see index value of that listitem
Hi @Abduerhman Salama
As per my understanding. Suppose you have a list of 50 items and you are showing 5 records per screen and you want to know start and last index of list item in every page.
So your index per page like this -
1st Page - 0-42nd Page - 5-9
-------
10th Page - 45-49.
Dynamically you can calculate like this -
1. In your first page end index = ((5*1) - 1) and end index = ((5*1) - 5) 2. In your second page end index = ((5*2) - 1) and end index = ((5*2) - 5)
3 In your 10th page end index = ((5*10) - 1) and end index = ((5*10) - 5)
I hope it'll help you.
ThanksDeep
Hi,
Have your issue solved ?
it's not pagination is a scroll and I want to know the index of first and last element in the view during the scroll
Hi @Abduerhman Salama ,
Basically we have two variable in aggregate for StartIndex and MaxRecord.
If you are talking about Start Index it always 0 when screen initiate and when you scroll it increases with plus 1. now you can calculate StartIndex 0 and MaxRecord is 10 so last index 9 on first scroll.
Thanks
Deepa