- Home
- Forum
- ASP.NET Core - EJ 2
- Setting pageSizes as HTML attribute
Setting pageSizes as HTML attribute
Can I change the default pages sizes from the dropdown list to a custom list by simply supplying a list or do I have to use a script?
Is something simple like the following possible:
<e-grid-pagesettings pageCount="5" pageSize="5" pageSizes="{ 5,10,25,50}"></e-grid-pagesettings>
Just on a note; I'm struggling a bit to find cohesiveness in the documentation. I'm jumping between documentation, samples, api, js api to find bits and pieces but I can't seem to find a single place where everything is documented.
Just to give you an idea of all the different "base" URL's you come across for a single feature:
https://ej2.syncfusion.com/aspnetcore/documentation/grid/paging.html
https://aspdotnetcore.syncfusion.com/Grid/DefaultPaging#/material
https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2~Syncfusion.EJ2.Grids.GridBuilder~PageSettings(GridPageSettings).html
https://help.syncfusion.com/js/grid/paging
https://ej2.syncfusion.com/16.1.32/aspnet/documentation/grid/paging.html?syntax=tag
On the last page, in the first paragraph, there is a link to PageSettings that isn't working. https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Grids.GridBuilder-1.html#Syncfusion_EJ2_Grids_GridBuilder_1_PageSettings_Syncfusion_EJ2_Grids_GridPageSettings_
SIGN IN To post a reply.
8 Replies
RD
Ronald Dirkx
July 9, 2018 01:30 PM UTC
Based on the example of how to add a toolbar I've figured out how to create my custom list: pageSizes="@(new int[] {5,10,15,20,25,50 })"
It works perfectly!!
One question remaining though: can I add the option "All" to this list as well?
Thanks
RS
Renjith Singh Rajendran
Syncfusion Team
July 10, 2018 10:37 AM UTC
Hi Ronald,
Thanks for contacting Syncfusion support.
We have provided the support to add the “All” option in the pageSizes drop down list in our latest patch release version (16.2.43). So we suggest you to update to our latest version and use the below codes to achieve your requirement.
|
<ejs-grid id="Grid" ...>
<e-grid-pagesettings pageSizes="@(new string[] { "5", "10", "15", "20", "25", "50","All" })"></e-grid-pagesettings>
<e-grid-columns>
...
</e-grid-columns>
</ejs-grid> |
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran.
RD
Ronald Dirkx
July 13, 2018 01:16 PM UTC
Hi Renjith
I used NuGet to update to Syncfusion.EJ2 ver. 16.2.0.44.
I can add the "All" option replacing my int array with a string array as shown in your example.
My grid starts fine, it shows all the possible page sizes including "All" and when I select one of the numeric page sizes everything continues to go well including changing page etc.
However, when I select "All" it runs into an error.
The method in my controller bound to the UrlAdaptor raised an error stating that the DataManagerRequest object is null (something that doesn't happen when I select one of the numeric values)
I have attached some screenshots to show you the initial state, selecting one of the other numeric values and the error thrown when selecting "All".
PS. not a high priority for me ...
Attachment: 001_Grid_Pagination_Error_with_All_40856c88.zip
RS
Renjith Singh Rajendran
Syncfusion Team
July 16, 2018 10:20 AM UTC
Hi Ronald,
Thanks for the update.
We have validated the reported issue. We suspect that you are using older version of Syncfusion scripts, which is the cause of the reported issue. “Support to provide show all record option in pager dropdown” feature had been rolled in our patch release (v16.2.43). If you are using older versions scripts than this, then you will face this issue. So we suggest you to upgrade to our latest version and refer the latest Syncfusion script files to overcome the reported problem.
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran.
RD
Ronald Dirkx
July 16, 2018 12:44 PM UTC
Hi Renjith
I'm referring to the scripts on CDN; my entry in _Layouts.cshtml (ASP.Net Core):
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
Ronald
RS
Renjith Singh Rajendran
Syncfusion Team
July 17, 2018 01:16 PM UTC
Hi Ronald,
Thanks for the update.
We could reproduce the same issue from the screenshot you have shared with us, only when we use Syncfusion scripts with older version less than 16.2.43. The All option works fine with all the version above 16.2.43. We have prepared a sample and video demonstration to show the non-reproduce of issue. Please download the video demo and sample from the links below,
Video Link : http://www.syncfusion.com/downloads/support/directtrac/general/ze/allpageoption662610321
We suspect that you may be facing cache problem. We suggest you to do the following,
- Clear the “bin” and “obj” folders.
- Clear the browser cache.
And also we suggest you to ensure in the “developer console window” of the Grid rendered page, whether you are having the line “onChange=function(e){"All"===this.dropDownListObject.value” in the cdn link you are using to render the Grid.
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran.
RD
Ronald Dirkx
August 11, 2018 03:09 PM UTC
This is working for me now, thanks
MS
Mani Sankar Durai
Syncfusion Team
August 13, 2018 08:50 AM UTC
Hi Ronald,
We are happy to hear that your problem has been solved.
Please let us know if you need further assistance.
Regards,
Manisankar Durai.
SIGN IN To post a reply.
- 8 Replies
- 3 Participants
-
RD Ronald Dirkx
- Jul 9, 2018 11:07 AM UTC
- Aug 13, 2018 08:50 AM UTC