【发布时间】:2010-10-17 19:06:15
【问题描述】:
当我使用自定义分页时,我在我的应用程序中使用 Infragistics UltraWebGrid 我无法检索每页指定数量的记录
我写的代码是 字符串[] cusLabel;
在网格中初始化
grid.DisplayLayout.Pager.AllowCustomPaging = true;
grid.DisplayLayout.Pager.AllowPaging = true;
grid.DisplayLayout.Pager.StyleMode = PagerStyleMode.CustomLabels;
grdSysManager.DisplayLayout.Pager.PageSize = 3;
getCustomLabel();
grdSysManager.DisplayLayout.Pager.CustomLabels = cusLabel;
private void getCustomLabel()
{
DataTable dt = (DataTable)grdSysManager.DataSource;
DataSet ds = new DataSet();
ds = dt.DataSet;
//ds = (DataSet)grdSysManager.DataSource;
int NoOfRows = ds.Tables[0].Rows.Count;
int PageSize = grdSysManager.DisplayLayout.Pager.PageSize;
if (NoOfRows % PageSize == 0)
{
totalNoOfPagings = NoOfRows / PageSize;
}
else
{
totalNoOfPagings = (NoOfRows / PageSize) + 1;
}
cusLabel = new string[totalNoOfPagings + 2];
cusLabel[0] = "First";
for (int i = 1; i <= totalNoOfPagings; i++)
{
cusLabel[i] = i.ToString();
}
cusLabel[totalNoOfPagings + 1] = "Last";
}
上面是我编写的代码,但它显示的是表中的所有记录,而不是 每页 3 条记录。我错过了什么吗?
谢谢
【问题讨论】:
标签: pagination infragistics ultrawebgrid