This is a migrated thread and some comments may be shown as answers.
Accept json format for filters on server side
3 Answers 35 Views
This is a migrated thread and some comments may be shown as answers.
vladan strigo
Top achievements
Rank 1
vladan strigo asked on 13 Jan 2017, 09:30 AM

Hi everyone

 

I'm using Kendo/Angular 2 grid with custom filters, paging and sorting and ASP.NET Core on the server side.

When sending POST request from client side, I have to format request parameters to "form data" because server side bindings uses that format by default in order to retrieve data for the grid.

Is there a way to configure server side code to accept json format instead of form data?

I have found an open source library which might do that: https://github.com/kendo-labs/dlinq-helpers but I'm wondering is there an option to do all this with standard Kendo.Mvc.UI library?

 

Thanks

Vladan

3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 18 Jan 2017, 06:14 AM
Hi Vladan,

The ToDataSourceResult method in available in the Kendo.Mvc.Extensions namespace:
using Kendo.Mvc.Extensions;

More information could be found at the following link:

Best Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
vladan strigo
Top achievements
Rank 1
answered on 18 Jan 2017, 09:11 AM

Hi Konstantin,

ToDataSourceResult works fine and there is no problem with that.

I'm interested in binding JSON model to DataSourceRequest model on server side instead of sending it as form-data. Is that possible?

 

Thanks

Vladan

0
Konstantin Dikov
Telerik team
answered on 23 Jan 2017, 07:39 AM
Hi Vladan,

You can stringify your JSON before sending the data to the controller and deserialize in the controller:
You can also take a look at the following article:

Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
vladan strigo
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
vladan strigo
Top achievements
Rank 1
Share this question
or