+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Want to give two columns for sorting in IList list = NewsManagerObject.Content.GetContent(0, int.MaxValue, "Publication_Date DESC", filters);

Want to give two columns for sorting in IList list = NewsManagerObject.Content.GetContent(0, int.MaxValue, "Publication_Date DESC", filters);

6 posts, 0 answered
  1. Esmail
    Esmail avatar
    5 posts
    Registered:
    26 Sep 2011
    03 Oct 2011
    Link to this post
    IList list = NewsManagerObject.Content.GetContent(0, int.MaxValue, "Publication_Date DESC", filters);

    Here i want to Sort By Both Publication_Date and Category
    This is not supported in Sitefinity 3.7.
    Is there any way to acheive this.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Oct 2011
    Link to this post
    Hello Esmail,

    You can add to IMetaSearchInfo filters or just using LINQ .

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Esmail
    Esmail avatar
    5 posts
    Registered:
    26 Sep 2011
    04 Oct 2011
    Link to this post
    How to give column values in place of Object Value.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Oct 2011
    Link to this post
    Hello Esmail,

    Could you clarify a bit more about column values you need? Column values are generally used in structures like DataSet.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Esmail
    Esmail avatar
    5 posts
    Registered:
    26 Sep 2011
    07 Oct 2011
    Link to this post

    IMetaSearchInfo

     

    [] filters = new IMetaSearchInfo[2];

     

    filters[0] =

    new MetaSearchInfo(MetaValueTypes.DateTime, "Publication_Date", Convert.ToDateTime(("1/1/" + LatestYear + " 12:00:00 AM").ToString()), SearchCondition.GreaterOrEqual);

     

    filters[1] =

    new MetaSearchInfo(MetaValueTypes.DateTime, "Publication_Date", Convert.ToDateTime(("12/31/" + LatestYear + " 12:00:00 PM").ToString()), SearchCondition.LessOrEqual);

     


     

    IList list = objmgr.Content.GetContent(0, int.MaxValue, "Publication_Date DESC", filters);

    I want to Sort Category also in descending which i am not able to do here.
    Here I can sort only Publication_Date in descending order

     

  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    07 Oct 2011
    Link to this post
    Hi Esmail,

    You can pass the "Category" to the filter. The MetaSeachInfo works only with metakeys. Again, the other option is filtering the list with LINQ.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
6 posts, 0 answered