For loop range

@rameezimtiaz
not really clear the question. Maybe these samples can help:
grafik

Also have a look here for paging / segmenting (Done on a datatable, but similar in the logic)