@rameezimtiaz not really clear the question. Maybe these samples can help:
Also have a look here for paging / segmenting (Done on a datatable, but similar in the logic)