The grid is being displayed which has pager enabled but displays all records without paging. Also the pager is displayed. Code for RegisterGrid() method is as below:-
public static void RegisterGrids()
{
GridDefaults defaultSet1 = new GridDefaults()
{
Paging = true,
ItemsPerPage = 5,
NoResultsMessage = "Sorry, no results were found"
};
MVCGridDefinitionTable.Add("grdFiles", new MVCGridBuilder<FilesModel>(defaultSet1)
.WithAuthorizationType(AuthorizationType.AllowAnonymous)
.AddColumns(cols =>
{
cols.Add("FileName")
.WithValueExpression(p => p.Name.ToString());
cols.Add("LastModified").WithHeaderText("LastModified")
.WithValueExpression(p => p.LastModified.ToString());
cols.Add("Size").WithHeaderText("Size")
.WithValueExpression(p => p.Size.ToString());
})
.WithRetrieveDataMethod((context) =>
{
var res = DisplayFiles();
return new QueryResult<FilesModel>()
{
Items = res,
TotalRecords = res.Count // if paging is enabled, return the total number of records of all pages
};
})
);
}
Hi,
The grid is being displayed which has pager enabled but displays all records without paging. Also the pager is displayed. Code for RegisterGrid() method is as below:-
View Code is:
Controller Code:-