Every example that has custom paging always fails to address the question. Every example has the controller receiving the DbContext for the ToDataSourceResult method to then do the paging which is not what is wanted.
Take a look at the example on this page: https://docs.telerik.com/aspnet-mvc/helpers/grid/binding/custom-binding#custom-ajax-binding
The problem is when we don't pass our DbContext this far up.
I'm trying to do custompaging on the grid, my controller calls a middle layer which does the paging and filtering and returns an IList<OrderViewModels> with only the 20 items for the page. Except it doesn't work unless I return all 700,000 records. Then it magically pages and somehow this is supposed to be called serverside paging. It is only paging at the UI layer which is incredibly inefficient. Granted it is not doing it on the client, but it is still no good if it is at the UI layer as I'm having to return all records from the datalayer.
This only works on page 1 and nothing on any other page, even though I can see that dataResults has data.