Try Now
More in this section

Forums / Bugs & Issues / GetContent sorting issue

GetContent sorting issue

2 posts, 0 answered
  1. Andreas
    Andreas avatar
    49 posts
    29 Dec 2007
    21 Feb 2008
    Link to this post

    I'm having some issues with the GetContent method of the ContentManager. The specific method where the problem arises is:
    ContentManager.GetContent(int from, int max, string sortExp, string tagName)

    Whats happening is that if I add a sorting expression the method doesnt bother with the tagname variable. The sorting expression in itself works fine, it just mess up filtering by tagname.

    So, with an empty string as sort sorting expression it filters the content by the tagname, with it it gets all content. That just doesnt seem right somehow. :)

    If you got any fix for this it'd be greatly appreciated.

  2. Georgi
    Georgi avatar
    3583 posts
    10 Oct 2016
    22 Feb 2008
    Link to this post
    Hello Andreas,

    The issue that you have with the GetContent method is due to the fact that sortExp work only with metadata, and the tags are not such type of data. Therefore, a workaround for you could be :
    1. Get your content using GetContent filtering only by tag name, in a collection.
    2. Sort that collection in the memory.

    A fix for that will not be available in 3.2, because this version has already been scheduled, and a final work on it is in progress. We plan to change the whole DataAccess Layer in version 4.0, so GetContent will be much more flexible.

    We wish you good luck and let us know if we could help you with anything in future.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered