AspNetPager无法分页的问题
我用的是GridView来绑定数据,而且还要实现正反排序
结果一直不能翻页,大家帮我看看
public void BindList()
{
SYSUSERBASEBiz obj = new SYSUSERBASEBiz();
DataTable dt = ..............
DataView dv = dt.DefaultView;
AspNetPager1.RecordCount = dv.Count;
dv.Sort = ViewState[ "sort "].ToString() + " " + ViewState[ "order "].ToString();
PagedDataSource pds = new PagedDataSource();
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
pds.PageSize = AspNetPager1.PageSize; ;
grList.DataSource = dv;
grList.DataBind();
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
BindList();
}
页面代码如下:
<table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td>
<asp:GridView ID= "grList " runat= "server " AllowSorting= "True " AutoGenerateColumns= "False " PagingStyle= "None " Width= "100% " OnRowDataBound= "grList_RowDataBound " OnRowCreated= "grList_RowCreated " OnSorting= "grList_Sorting " OnRowCommand= "grList_RowCommand " AllowPaging= "True ">
<HeaderStyle CssClass= "datalist1_top "> </HeaderStyle>
<RowStyle CssClass= "datalist2_content " />
<Columns>
&nb