We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Server side paging

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)


3 Replies

RN Rahul Narayanasamy Syncfusion Team July 29, 2019 05:28 PM UTC

Hi Alexandre, 
 
Greetings from Syncfusion. 
 
Query: CurrentPage = Convert.ToInt32(args?.CurrentPage ?? 0), // why CurrentPage is double? 
 
We are validating your requirement and we have provided common Type(Double for some properties) for all of our syncfusion components. Could you please share the information if you have face any issues due to this Type.  
 
Query: 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 
 
Currently we are validating your requirement at our end and we will further update you on July 30, 2019. Until then we appreciate your patience. 
 
Regards, 
Rahul. 



AR Alexandre Reyes Martins July 29, 2019 05:36 PM UTC

Tks Rahul!

PageCount will never be a double, it's a integer information, makes no sense to be a double.

About server side paging: I don't know if I'm doing the right way, i wish you could take the idea witch is: My domain dll has parameters to browse entities paged, so, I need a way to tell grid grid total count, something like this:



RN Rahul Narayanasamy Syncfusion Team July 30, 2019 01:26 PM UTC

Hi Alexandre, 
 
Thanks for your update. 
 
Query: PageCount will never be a double, it's a integer information, makes no sense to be a double. 
 
We have validated the bug that you have initiated with us and we considered and logged “incorrect return type is returned while using PageSettings property in Blazor” as a bug. Thank you for taking the time to report this issue and helping us improve our product. The fix for this issue will be included in our upcoming NuGet release which will be expected to be rolled out on August 19, 2019. 

You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  


Query: About server side paging: I don't know if I'm doing the right way, i wish you could take the idea witch is: My domain dll has parameters to browse entities paged, so, I need a way to tell grid grid total count, something like this: 
 
We have validated your query and you can achieve your requirement by using custom data binding concept. But currently we don’t have custom binding support. We have already considered “provide custom data binding support for blazor” as a feature and this feature will be available in our upcoming NuGet release which will be expected to rolled out on August 30, 2019. Until then we appreciate your patience. 
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
 
 
Regards, 
Rahul 


Loader.
Live Chat Icon For mobile
Up arrow icon