PagedDataSource Count
本文关键字:Count PagedDataSource | 更新日期: 2023-09-27 18:02:14
我使用pageddatasource
对datalist
控制进行分页,但是当将pageddatasource
绑定到linq查询时,虽然查询结果不同(ResultQuery_Count = 13
和PagedDataSource
计数总是10),但计数并不改变。IsFirstPage
和IsLastPage
也总是为真
代码如下:
PagedDataSource objPage = new PagedDataSource();
try
{
objPage.AllowCustomPaging = true;
objPage.AllowPaging = true;
objPage.DataSource = Getter.GET_GeneralResult();
objPage.PageSize = 8;
objPage.CurrentPageIndex = CurrentPage;
lbtnNext.Enabled = !objPage.IsLastPage;
lbtnPrev.Enabled = !objPage.IsFirstPage;
DataList1.DataSource = objPage;
DataList1.DataBind();
}
catch (Exception ex)
{
throw ex;
}
更新查询时,是否重新绑定了数据表?