Skip to content

Instantly share code, notes, and snippets.

@arviman
Created November 2, 2011 19:38
Show Gist options
  • Save arviman/1334658 to your computer and use it in GitHub Desktop.
Save arviman/1334658 to your computer and use it in GitHub Desktop.
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