Created
November 2, 2011 19:38
-
-
Save arviman/1334658 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void LoadData(int take, int pageSize) | |
{ | |
//somehow return all the objects you need. could be a datatable instead of a list of objects | |
List articles = GetAllItems(); | |
//set total item count | |
RowCount = articles.Count; | |
var topDocs = (from c in articles select c).Skip(pageSize).Take(take); | |
PagedDataSource pagedSrc = new PagedDataSource(); | |
pagedSrc.DataSource = topDocs; | |
pagedSrc.PageSize = itemsPerPage; | |
pagedSrc.AllowCustomPaging = true; | |
pagedSrc.AllowPaging = true; | |
this.Repeater1.DataSource = topDocs; | |
this.Repeater1.DataBind(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment