J'utilise Infragistics UltraWebGrid dans mon application lorsque j'utilise la pagination personnalisée Je ne suis pas en mesure de récupérer le nombre spécifié d'enregistrements par pageInfragistics UltraWebGrid pagination personnalisée
Le code que je l'ai écrit est string [] cusLabel;
dans la grille initialiser
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";
}
Au-dessus est le code que j'écrit, mais il affiche tous les enregistrements de la table au lieu de 3 enregistrements par page. Est-ce que je manque quelque chose?
Merci