WebApiDataSourceRequestModelBinder multiple column sort query string parameter format

3 posts, 1 answers
  1. esp
    esp avatar
    16 posts
    Member since:
    Jul 2016

    Posted 09 Mar 2017 Link to this post

    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. Answer
    Vasil
    Admin
    Vasil avatar
    1640 posts

    Posted 13 Mar 2017 Link to this post

    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.
  3. esp
    esp avatar
    16 posts
    Member since:
    Jul 2016

    Posted 13 Mar 2017 in reply to Vasil Link to this post

    ?sort=Discontinued-asc~ProductName-desc&page=1&pageSize=10

    Thank you!

Back to Top