Use a PagedDataSource instance:
int CurPage;
PagedDataSource myPds;
DataSet ds;
// ... Instanciate DataSet ...
myPds = new PagedDataSource();
myPds.AllowPaging = true;
myPds.PageSize = 10;
myPds.DataSource = ds.Tables[0].DefaultView;
CurPage = (Request.QueryString["Page"] != null) ?
Convert.ToInt32(Request.QueryString["Page"]) : 1;
myPds.CurrentPageIndex = CurPage-1;
CurrentPageLbl.Text = "Page: " + CurPage.ToString();
DataList1.DataSource=objPds;
DataList1.DataBind();
You can also set your Navigation Links by looking at the values of
myPds.IsFirstPage and myPds.IsLastPage
Victor.
--- In [email protected], "Veeraraghavan, Ravi
TCX12" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to do paging in the data List control in asp.net? I cannot
see any
> properties for the control like datagrid
> How to implement paging in data list?
>
>
>
>
>
>
>
>
>
> Best Regards,
> Veeraraghavan Ravi-TCX12
> Petroleum Development Oman LLC
> * PO Box 81, Postal Code 113
> Muscat, Sultanate of Oman
> *+968-24670298(Office)
> +968-99514325 (Mobile)
>
>
>
>
>
> [Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/