Telerik Kendo grid how to do server side paging and client side sorting ,filtering

1 Answer 117 Views
Announcements Let's talk about telerik (the good and the bad) Miscellaneous
Amir
Top achievements
Rank 1
Amir asked on 14 Jun 2023, 10:03 AM | edited on 17 Jun 2023, 07:18 PM

Kendo grid  Issue while doing  server side paging and client side sorting ,filtering  in dot net core mvc 

Amir
Top achievements
Rank 1
commented on 17 Jun 2023, 07:16 PM

i have tried data binding through custom datasource  i m able to do server side paging  but  Sorting Filtering are also happening on  server side 

AS per code I have set serverfilter to false it should happen at client side but still making hit to method 

 

Please suggest and provide a solution to acheive server side paging only rest sorting filtering grouping at clientside ASAP

 

@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.DataSource(dataSource => dataSource
.Custom()
.Type("aspnetmvc-ajax")
.PageSize(10)
.ServerPaging(true)
.ServerSorting(false)
.ServerFiltering(false)
.Transport(transport => transport
.Read(read => read.Action("Read", "Home"))
)
.Schema(schema => schema
.Data("Data")
.Total("Total")
.Errors("Errors")
.Parse(@<text>function (data) {
// configure a parse function only if the response (data) must be
// transformed in some way before data binding
return data;
}</text>)
.Model(model => {
model.Id("OrderID");
model.Field("OrderID", typeof(int));
model.Field("OrderDate", typeof(DateTime));
model.Field("OrderDescription", typeof(string));
model.Field("IsCompleted", typeof(bool));
})
)
)
)

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 19 Jun 2023, 04:36 AM

Hi Amir,

Generally, mixing the client-side and server operations is not recommended. A similar topic has been discussed within the following forum post that could potentially shed more light into the subject:

Nonetheless, if you wish to have full ownership over which server operations should be enabled, a possible approach would indeed involve defining a custom DataSource that allows you to explicitly set the client-side API options of the Kendo UI for jQuery DataSource. You have to separately state the server operations: (server-filtering, server-sorting, server-paging, server-grouping, and server-aggregates).

However, it is important to explicitly set all of the operations based on your requirements and needs. For example:

.DataSource(dataSource => dataSource
    .Custom()
    .Type("aspnetmvc-ajax")
    .PageSize(10)
    .ServerPaging(true)
    .ServerSorting(false)
    .ServerFiltering(false)
    .ServerGrouping(false)
    .ServerAggregates(false)
    ...
)

This way, you can still preserve the current page and count being passed on the backend, whilst relying on the filtering and sorting being automatically calculated on the client side.

If the mentioned above sample still executes the filtering on the server-side, I would recommend sharing an isolated runnable sample where the issue is reproduced.

Additionally, I have noticed there is no Telerik UI for ASP.NET Core Licenses associated with your account. Meaning that this further limits our support service as a whole. And the recommended action would be to either purchase or renew an existing license in order to make the most of the suite's features, bug fixes, and support service.

Although the mentioned above link contains the Support Plans, I am sending them here as well:

Kind Regards,
Alexander
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Tags
Announcements Let's talk about telerik (the good and the bad) Miscellaneous
Asked by
Amir
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or