views:

112

answers:

0

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;


    }

I ve put this function in Web conttrol.I am populating a repeater control and control within Repeater is a User control.Everything is OK with Repeater and user control But....

This 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);

  Please Help! it  is taking me too much time.