I would be happy not to know the total number of rows or even the number of pages. So I've tried turning off Info and Numeric paging options, but the count is still being calculated.
I've tried switching to a virtual scrolling grid as this seems to be Kendo's recommended approach for large datasets, but it seems this also performs a count so that it knows how big a scrollbar to show.
Is there any way to use the kendo grid without performing a count on the total number of items?
9 Answers, 1 is accepted

How many rows of data are you bringing to the page?

I'm using the asp.net mvc wrappers. Grid is server bound, In the controller I define an IQueryable that is then passed in to the constructor Kendo().Grid<MessageSummary>(messages). This allows the default server binding to apply the appropriate Skip, Take, Filters etc defined in the grid.
Getting the actual rows is fairly good performance, but the default server binding also calls Count() on the datasource, which is rather an expensive query in my case. As an example the total count of matching rows might be something like 2,000,000. However these 2,000,000 rows will be in a table with several million rows that do no match the query, performing a count on this query can be expensive.

The information about the total number of data items is required and cannot be skipped. As an alternative to the Grid's native databinding methods, you can use custom binding and optimize the queries according to your preferences:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/custom-binding
You will still need information about the total data count, but you can retrieve it in a different way, if needed.
Also, please avoid posting duplicate threads in the forum and the ticketing system. Thank you for understanding.
Dimo
Telerik

why in "virtual scrolling on" you need count
IDEA
without count
no of # 2000000000
page size 20 #
1. read first 21 record and (if you get more than 21 records return 20 and bind it to the grid + show next button) if you get less than 21 # return it all and there is no next button
2. in the next page you can also turn on prev button because you know that 1 page is loaded before and read # from 20-41 (same logic as step 1 )
3. ..........
erik
Total count is required when using virtual scrolling, because this functionality is actually a paging that looks like scrolling. Only a [pageSize] number of records are rendered inside the Grid. The page that is displayed depends on the scrollbar position. This scrollbar is not real and its rendering also depends on the total number of records.
Dimo
Telerik

[prev], [next] for what you don't need count.
Such an implementation and behavior is theoretically possible to achieve (even currently with custom code using the Kendo UI DataSource and Grid APIs), but we don't regard it as user-friendly and don't recommend it.
Dimo
Telerik

For any interested party here are some steps/tips:
In the Controller:
- Take a DataSourceRequestParameter (if null check that Prefix is correct)
- Set the pagesize to a default if not set. (make sure it's the same default as in the view!)
- Get an IQueryable for your data
- apply request.filters using Kendo extension method "Where"
- apply request.sorts using Kendo extension method "Sort"
- Calculate the number of items to skip (request.Page-1) * request.Page
- Apply the skip
- Apply a Take as request.PageSize+1 (+1 so that we know if there is at least one item on the next page)
- Execute the query (query as IQueryable<ItemType>).ToList()
- Record the total as being the number of items returned from the query + the skip calculated earlier. (If 0 items returned probably best to return 0, but not fully tested trying to access a page beyond the limit)
- Store the first PageSize number of items from the query (throwing away the last item).
- Use constructor that takes IEnumerable, to pass in the results of the query (apart from the last item)
- Turn on "EnableCustomBinding"
- In the DataSource specify the Total that we calculated in the Controller
- In the Pageable configuration turn off Numeric, change the Messages.Display to "{0} - {1}"
a[title="Go to the last page"]{ display:none;}
I think it would be nice to include the Last Page, with the query's sort direction being reversed, but I've not done this yet, and I think it would require some interception at some point so that it's not just "GetPage2" but "GetLastPage"
Looking at how the default server binding works (using Telerik JustDecompile) is a valuable resource in terms of duplicating the default server binding (omitting the call to Count()). If I go ahead to do Grouping I imagine this will be how I will do it.
Hope that helps someone!