tags:

views:

69

answers:

0

I have not received any answer from previous question therefore I am revising it again.

public PagedDataSource GetPage(int index) {

    PagedDataSource pageddatasrc = new PagedDataSource();
     //pageddatasrc.AllowCustomPaging = true;
    // pageddatasrc.AllowServerPaging = true;
     pageddatasrc.AllowPaging = true;
    pageddatasrc.DataSource = ODatasource;//where ODatasource is EntitiesCollection<GenericCustomcolection>

    pageddatasrc.PageSize = 2;

    pageddatasrc.CurrentPageIndex = index ;



    return  pageddatasrc;


}

his PageDatasource always returns first two records for every call.I set Index =0,1,2

but It returns only 2 records while data source has 6 records.

from page the called code is:

PagedDataSource pageddatasrc = paginglinks.GetPage(Args.PageNo);

I set Allowcustompaging setting but now it throws Http exception demanding that data source should implement Icollection.my data source is Generic collection implementing IList and implements every method and property of it.When i set Allowcustompaging=true, it does not that give that error however it loads only first records does not navigate into next records while I set currentpageindex=0,1,2 etc.