Guest User

Untitled

a guest
Jan 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. void LoadOffers()
  2. {
  3. // Offers is IQueryable<T> populated from the parent aspx page
  4. // It contains the unpaged rows
  5.  
  6. // The page method selects the rows to display and returns rowCount as
  7. // the total number of rows in the unpaged selection
  8.  
  9. int rowCount = 0;
  10. Offers = Offers.Page(CurrentPage,10, o => o.OfferId, true, out rowCount);
  11.  
  12. // My ListView control
  13. var ds = new ListViewPagedDataSource();
  14. ds.AllowServerPaging = true;
  15. ds.DataSource = Offers.ToList();
  16. ds.MaximumRows = 10;
  17. ds.StartRowIndex = 0;
  18. ds.TotalRowCount = rowCount;
  19.  
  20. LV_Offers.DataSource = ds;
  21. LV_Offers.DataBind();
  22.  
  23. // My DataPager control
  24. DP_Offers.PageSize = 10;
  25. DP_Offers.SetPageProperties(0, rowCount, false);
  26. }
Add Comment
Please, Sign In to add comment