Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LoadOffers()
- {
- // Offers is IQueryable<T> populated from the parent aspx page
- // It contains the unpaged rows
- // The page method selects the rows to display and returns rowCount as
- // the total number of rows in the unpaged selection
- int rowCount = 0;
- Offers = Offers.Page(CurrentPage,10, o => o.OfferId, true, out rowCount);
- // My ListView control
- var ds = new ListViewPagedDataSource();
- ds.AllowServerPaging = true;
- ds.DataSource = Offers.ToList();
- ds.MaximumRows = 10;
- ds.StartRowIndex = 0;
- ds.TotalRowCount = rowCount;
- LV_Offers.DataSource = ds;
- LV_Offers.DataBind();
- // My DataPager control
- DP_Offers.PageSize = 10;
- DP_Offers.SetPageProperties(0, rowCount, false);
- }
Add Comment
Please, Sign In to add comment