This is a migrated thread and some comments may be shown as answers.

WebApiDataSourceRequestModelBinder multiple column sort query string parameter format

2 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
esp
Top achievements
Rank 1
Veteran
esp asked on 10 Mar 2017, 03:36 AM

How can I format multiple sort query string parameters so that a WebAPI method expecting a DataSourceRequest (WebApiDataSourceRequestModelBinder) will parse correctly?

A query string such as

?page=1&pageSize=10&sort=foo-asc

works fine for paging and single column sort. What should the query string parameters look like for multiple column sort?

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vasil
Telerik team
answered on 13 Mar 2017, 03:35 PM
Hi Esp,

The delimiter used for deserialization is "~".
For example:
?sort=Discontinued-asc~ProductName-desc&page=1&pageSize=10

Regards,
Vasil
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
esp
Top achievements
Rank 1
Veteran
answered on 13 Mar 2017, 08:50 PM

[quote]?sort=Discontinued-asc~ProductName-desc&page=1&pageSize=10[/quote]

Thank you!

Tags
Grid
Asked by
esp
Top achievements
Rank 1
Veteran
Answers by
Vasil
Telerik team
esp
Top achievements
Rank 1
Veteran
Share this question
or