How do I serialize FilterDescriptions in GridCommand?

2 posts, 0 answers
  1. Daniel Corbett
    Daniel Corbett avatar
    24 posts
    Member since:
    Jun 2009

    Posted 26 Aug 2010 Link to this post

    There's a route to deserialize GridCommand (GridCommand.Parse), that takes serialized versions of orderBy, groupBy, and filterBy.   I can find ways to serialize sortDescriptors & groupDescriptors, but I can't find code that will serialize filterDescriptors into the same serialized string.

    I see an example of what it serializes to, and I can see code in GridBoundColumnSerializer.cs that converts it to a Dictionary, but nothing that turns it into a string.

    I need this because I need to create my LINQ query in a webservice, and pass it through my MVC Controller.    I need to pass it through in order to add additional search criteria from the search form (that aren't represented in the result DTO that is sent back).

    Unfortunately passing CommandGrid to the WebService fails, because the FilterDescriptors don't serialize automatically.
    Passing List<FilterDescriptor> fails as well.
    I tried using XMLSerializer to serialize it, but it fails because CompositeFilterDescriptor has a Collection of IFiltorDescriptor in it, and it can't serialize interfaces.

    Please assist.


       - Daniel
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 27 Aug 2010 Link to this post

    Hi Daniel Corbett,

    We don't have code which serializes filter descriptors. We only have code which deserializes them. Perhaps you can use some the extension methods which accept the filter expression as a string. You can check the QueryableExtensions.cs file from the source distribution. Also you can check the web service binding example if you have not already.

    Atanas Korchev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top