Closed meister-d closed 9 years ago
If you're using the abstract class BsBaseGridRepository<TEntity, TRow>
first of all you have to specify the PageSize
property of the BsGridRepositorySettings<TSearch>
:
var settings = new BsGridRepositorySettings<ContributorSearchModel>()
{
PageSize = 15,
Page = 1
};
var gridModel = _gridRepository.ToBsGridViewModel(settings , x => x.Id);
That's how you'll set the number of rows to be retrieved from the database.
Second, you have to change the grid pager rendering settings and include your custom value to the PageSizeValues
property:
@Html.BsGridFor(m => m.Grid)
PagerSettings(new BsPagerSettings
{
PageSizeValues = new List<int> { 5, 15, 20, 25, 50 }
})
If you still have any problems, please let me know and show me your code (controller, view)
Thanx Cristi, like this it works for me.
Where can I configure the Default value of Items per Page (in the Grid control)? I would like to have 15 Items per Page. I tried allmost every where, in code behind, in Razor but no Chance. Can you please also Update it in the Docs if its possible ?
Regards Dumitru