4 Answers, 1 is accepted
0
Hi Preet,
If you have disabled the paging and you are using Ajax binding you can use the length of the data field provided by the Grid object to display the number of the records via the OnDataBound event.
e.g.
I hope this helps.
Kind regards,
Petur Subev
the Telerik team
If you have disabled the paging and you are using Ajax binding you can use the length of the data field provided by the Grid object to display the number of the records via the OnDataBound event.
e.g.
function onGridDataBound(e) { var recordsCount = $(this).data('tGrid').data.length; $('.t-status',this).after('<span>Number of records :'+ recordsCount +'</span>')}I hope this helps.
Kind regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
preet
Top achievements
Rank 1
answered on 13 Jun 2012, 11:52 PM
Thanks a lot for your reply. I found out another solution as well. I am setting the number of pages in OnComplete client event by accessing response.total.
So it is something like this.
.OnComplete( @<text> function(e){
addTotalRecordCounterToGridFooter("@gridId",e.response.total);
}</text>
)
So it is something like this.
.OnComplete( @<text> function(e){
addTotalRecordCounterToGridFooter("@gridId",e.response.total);
}</text>
)
0
Nagendra
Top achievements
Rank 1
answered on 21 Mar 2013, 03:58 PM
Hi,
i am using the same code as u mentioned,on page load its showing the proper record,but on filtering the grid,the the values are appending with previous one for example first time grid contain 50 records,it showing "Displaying:50 records" on filtering my grid contain 34 records at that time it showing "Displaying:50 records Displaying:34 records" is there any solutions?
i am using the same code as u mentioned,on page load its showing the proper record,but on filtering the grid,the the values are appending with previous one for example first time grid contain 50 records,it showing "Displaying:50 records" on filtering my grid contain 34 records at that time it showing "Displaying:50 records Displaying:34 records" is there any solutions?
0
preet
Top achievements
Rank 1
answered on 21 Mar 2013, 10:37 PM
Hi Nagendra,
Here is the method:
Hope this helps
Here is the method:
function addTotalRecordCounterToGridFooter(gridId, numOfRecords) {
$("#" + gridId + " .dummyFooter").remove();
$("#" + gridId + " .t-grid-pager").append("<div class='dummyFooter' style='float:right; padding-right:12px;'>Total " + numOfRecords + " record(s) shown</div>");}Hope this helps