PagedDataSource Count

本文关键字:Count PagedDataSource | 更新日期: 2023-09-27 18:02:14

我使用pageddatasourcedatalist控制进行分页,但是当将pageddatasource绑定到linq查询时,虽然查询结果不同(ResultQuery_Count = 13PagedDataSource计数总是10),但计数并不改变。IsFirstPageIsLastPage也总是为真

代码如下:

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;
}

PagedDataSource Count

更新查询时,是否重新绑定了数据表?