160
Views
7
Comments
i want to know the index of first and last element in the mobile view
Question

i have a list and i want to know the index of first and last element in the mobile view 

2020-05-07 18-53-00
Rui Barradas
 
MVP

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

2025-01-02 13-34-30
Abduerhman Salama

no i want last element in the view port of mobile not last element in the list 

UserImage.jpg
Nani

add expression to the list and give list .current.index value so you can see index value of that listitem

2024-09-12 02-43-38
Deepsagar Dubey

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-4
2nd 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.

Thanks
Deep


2024-09-12 02-43-38
Deepsagar Dubey

Hi,

Have your issue solved ?

2025-01-02 13-34-30
Abduerhman Salama

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

2026-05-21 04-48-12
Deepa Tiwari

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.