Hi!
I'm trying to achieve server side paging with EjsGrid, here is how:
protected IEnumerable MyDataSource
=> MyDataSourceResponse ?.Results ?? new List();
protected async override Task OnInitAsync()
{
await base.OnInitAsync();
await OnActionBegin(null);
}
protected async Task OnActionBegin(ActionEventArgs args = null)
{
MyDataSourceResponse = await GetMyDataMethod(
new MyParameters()
{
CurrentPage = Convert.ToInt32(args?.CurrentPage ?? 0), // why CurrentPage is double?
PageSize = 5,
OrderBy = "Name",
OrderByType = args?.Direction != SortDirection.Descending ? "ASC" : "DESC",
SearchArg = args?.SearchString
}
);
grid.PageSettings.PageCount = MyDataSourceResponse.PageCount;
// i can't find a way to tell grid the TotalCount....
}
the problem is that grid never shows more than one page and said that there is only 5 registers, i thing is because the miss property TotalCount
How to achieve this? (I can't use url adapter because my application is also running on Android, so, there is no server when using mobile)
The problem print screen: (It should show 20 registers and 4 pages)