Paging message not showing

1 Answer 122 Views
Grid
Stacey
Top achievements
Rank 1
Stacey asked on 26 Oct 2023, 06:49 PM

I'm testing out Kendo grid for .net core razor.

@(Html.Kendo().Grid<Models.Address>(Model.addresses)

        .Name("grid")
        .Scrollable()
        .Pageable(pager => pager
           .Messages(messages => messages.Display("Records from {0} to {1} of {2}"))
        )
        .Sortable()
        
        .Columns(columns =>
        {
            columns.Bound(column => column.Id);
            columns.Bound(column => column.StreetAddress);
            columns.Bound(column => column.City);
            columns.Bound(column => column.Zip);
            columns.Bound(column => column.Id).ClientTemplate("<input type='button' class='k-button' onclick=\"location.href='./AddressEdit/#=Id#'\" value='Edit' />")
             .Title(" ");
        })
        .DataSource(ds => ds
            .Ajax()
            .PageSize(20)
            .ServerOperation(false)
        )
    )

 

For some reason the paging information below always has style display:none when inspecting the source. Is there a setting to make it visible?

<span class="k-pager-info k-label" style="display: none;">Records from 41 to 60 of 200</span>

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 31 Oct 2023, 02:25 PM

Hi Stacey,

Thank you for taking some extra time to share the relevant Grid configuration.

It appears that the reported behavior is related to the fact that internally, the Grid will make initial calculations based on the viewport's dimensions. Which will inevitably lead to the obscurement of the pager info.

In order to alter this behavior, I would recommend setting the .Pageable.Responsive() API configuration explicitly to "false". For example:

.Pageable(pager => pager
   .Messages(messages => messages.Display("Records from {0} to {1} of {2}"))
   .Responsive(false)
)

This should then produce the following visual representation:

For your convenience, I am also attaching a runnable example that further exhibits the above illustration with a similar Grid configuration as yours.

Please give this suggestion a try and let me know how it works out for you.

Kind Regards,
Alexander
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Tags
Grid
Asked by
Stacey
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or