Grid page settings using razor syntax not working

Hello

I am using ASP.NET CORE EJ 2 version 16.1.0.34 (nuget package).

The Grid's page settings do not seem to work when using the razor syntax.
When setting the page settings using tag-helper syntax the dropdown for the page size is displayed and works correctly.

...
<e-grid-pagesettings pageCount="5" pageSize="10" pageSizes="true"></e-grid-pagesettings>
...

When using razor syntax to achieve the same thing the dropdown is not displayed.

...
.PageSettings(page =>
{
    page.PageSize(10);
    page.PageSizes(5);
    page.PageCount(5);
}
...

Is there anything else that needs to be done when using razor syntax?


Kind regards
Phil

3 Replies

MS Mani Sankar Durai Syncfusion Team April 25, 2018 11:57 AM UTC

Hi Phil, 

Thanks for contacting Syncfusion support.  

We have checked the provided code example and found that you have set the pageSizes property of pageSettings in grid incorrectly. We suggest you set the pageSizes property as true (Boolean type) or a list of object (to set the own customized drop-down values) 
Please refer the code example 
 
        @Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowFiltering().Columns(col => 
        { 
... 
 
        }).AllowPaging().PageSettings(page=>page.PageSizes(true)).Render() 

If you want to render the dropdown based on our own pageSizes value please refer the code example 
@Html.EJS().Grid("InlineEditing").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowFiltering().Columns(col => 
   { 
... 
 
   }).AllowPaging().PageSettings(page=>page.PageSizes(new List<object>() { 5, 10 })).Render() 


Please let us know if you need further assistance.  

Regards, 
Manisankar Durai. 



UN Unknown April 25, 2018 12:14 PM UTC

You are absolutely right.
Using a boolean or a list works perfectly fine.

Thank you for your reply.


MS Mani Sankar Durai Syncfusion Team April 26, 2018 03:44 AM UTC

Hi Phil, 

We are happy to hear that your problem has been solved.  

Please let us know if you need further assistance.  

Regards, 
Manisankar Durai. 
                                


Loader.
Up arrow icon