6 Answers, 1 is accepted
The most straight-forward approach for achieving the server-side data operations in a .NET-based backend and consume it in a Kendo UI for Angular Grid, is described in the following section of our documentation:
We suggest the general mechanism for a custom implementation to follow this pattern:
1) The Grid emits a filterChange (and subsequently - a dataStateChange) event that contain the current filter descriptors
2) Typically there is a data service that is called in the Grid event handler, passing the filters (or the whole state depending on whether all data operations like paging, sorting, etc. will be handled on the server)
3) The client data service performs a request to the remote server (in this case - the .NET backend API), passing the Grid state (the state needs to be serialized in a way that will be parsed successfully on the server - in our example this is done by the toDataSourceRequestString() function)
4) The request data is parsed on the server, the respective database query or other data manipulations are performed, and the resulting data set (typically an object with properties "data" that contains the data items collection, and "total" - the total number of items) is passed back as a response
5) The response is processed on the client such that the data object the Grid is bound to is updated with the new items and the Grid is rerendered.
I hope this helps.
In general the grid is agnostic of where its data comes from. You can check the following article, dedicated to the data-binding of the grid, demonstrating some examples:
We can further handle the (dataStateChange) event and send the current state of the grid to the server, where some custom logic can be implemented in order to do server filtering, sorting, paging etc. Indeed, the developer is control of using the proper server side technology and implementation, that will meet the requirements for the specific use case scenario.
In case further assistance is required for this case, could you open a new support ticket, where we can continue the discussion. This will help us to keep a clean history of the forum. Thank you in advance.
Please check the following example projects using the DataSourceRequest model binder to perform data operations on the server:
Both projects are referenced in the earlier suggested article in this thread:
I hope this helps.
Our thoughts here at Progress are with those affected by the outbreak.
Where did the above link move to?
The URL now has a dash in the "data-query" part:
I apologize for the inconvenience.
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Is it possible to add server-side comparer logic to sort descriptors? The grid is based on served dto's that do not perfectly match the data models.
For example, an items grid has a column 'IsAvailable' where the database contains the names of people that booked an item. I would like users to be able to sort (and filter) on availability (true/false) but also handle it server-side because of pagination.