PagedDataSource Count
i am using pageddatasource
to make paging for datalist
control, but when binding pageddatasource
to linq query, the count doesn't change although the result of query is different (ResultQuery_Count = 13
AND PagedDataSource
count always 10). and IsFirstPage
and IsLastPage
always true as well
here's the Code :
PagedDataSource objPage = new PagedDataSou开发者_Python百科rce();
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;
}
When the query is updated, did you rebind the datalist?
精彩评论