I am using the kendoUI grid to show records from a table. I would like to display the total number of records so the table. something like
showing 1-20 of 1203 records
is there a way to show the total number of records using KendoUI grid?
All you have to do is add this to your .kendoGrid
dataBound: function (e) {
//total bits needs to be removed because dataBound fires every time the gird pager is pressed.
$('#totalBits').remove();
//add the total count to the pager div. or whatever div you want... just remember to clear it before you add it.
$('.k-grid-pager').append('<div id="totalBits">' + this.dataSource.total() + '</div>')
}
The MVC wrapper code I used to display a footer(pager) with only the record count looked like this:
@(Html.Kendo().Grid(dataSource)
.Columns(...)
.Pageable(p => p.Numeric(false)
.PreviousNext(false)
.Messages(m => m.Display("Matching Students: {2}")))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With