Skip to main content
Tweeted twitter.com/#!/StackTridion/status/498778261502328832
formatted the content
Source Link
Siva Charan
  • 4.3k
  • 1
  • 20
  • 36

i amI'm trying to sort the IcomponentIComponent list by a "Field Value" in the component using ExtendedQueryParametersExtendedQueryParameters, but by default the QuerySortFieldQuerySortField is assigned with default value. helpHelp me to sort with other fields in the component.

example iExample, I want to sort the list by date field in the component.

howHow can iI change this QuerySortField,

    public ExtendedQueryParameters()
    {
        // Default all parameters
        QuerySchemas = new string[]{};
        MetaQueryValues = new List<MetaQueryItem>();
        MetaQueryLogic = QueryLogic.AllCriteriaMatch;

        KeywordValues = new List<KeywordItem>();
        KeywordQueryLogic = QueryLogic.AllCriteriaMatch;

        LastPublishedDate = DateTime.MinValue;

        **QuerySortField = "ItemTitle";**
        SortType = MetaSortFieldType.STRING;
        SortType = MetaSortFieldType.DATETIME;
        QuerySortOrder = MetaQueryOrder.Ascending;
        MaximumComponents = int.MaxValue;
    }

i am trying to sort the Icomponent list by a "Field Value" in the component using ExtendedQueryParameters, but by default the QuerySortField is assigned with default value. help me to sort with other fields in the component.

example i want to sort the list by date field in the component.

how can i change this QuerySortField

    public ExtendedQueryParameters()
    {
        // Default all parameters
        QuerySchemas = new string[]{};
        MetaQueryValues = new List<MetaQueryItem>();
        MetaQueryLogic = QueryLogic.AllCriteriaMatch;

        KeywordValues = new List<KeywordItem>();
        KeywordQueryLogic = QueryLogic.AllCriteriaMatch;

        LastPublishedDate = DateTime.MinValue;

        **QuerySortField = "ItemTitle";**
        SortType = MetaSortFieldType.STRING;
        SortType = MetaSortFieldType.DATETIME;
        QuerySortOrder = MetaQueryOrder.Ascending;
        MaximumComponents = int.MaxValue;
    }

I'm trying to sort the IComponent list by a "Field Value" in the component using ExtendedQueryParameters, but by default the QuerySortField is assigned with default value. Help me to sort with other fields in the component.

Example, I want to sort the list by date field in the component.

How can I change this QuerySortField,

public ExtendedQueryParameters()
{
    // Default all parameters
    QuerySchemas = new string[]{};
    MetaQueryValues = new List<MetaQueryItem>();
    MetaQueryLogic = QueryLogic.AllCriteriaMatch;

    KeywordValues = new List<KeywordItem>();
    KeywordQueryLogic = QueryLogic.AllCriteriaMatch;

    LastPublishedDate = DateTime.MinValue;

    **QuerySortField = "ItemTitle";**
    SortType = MetaSortFieldType.STRING;
    SortType = MetaSortFieldType.DATETIME;
    QuerySortOrder = MetaQueryOrder.Ascending;
    MaximumComponents = int.MaxValue;
}
Source Link

DD4T: How to Sort Component list from FindComponents by Field

i am trying to sort the Icomponent list by a "Field Value" in the component using ExtendedQueryParameters, but by default the QuerySortField is assigned with default value. help me to sort with other fields in the component.

example i want to sort the list by date field in the component.

how can i change this QuerySortField

    public ExtendedQueryParameters()
    {
        // Default all parameters
        QuerySchemas = new string[]{};
        MetaQueryValues = new List<MetaQueryItem>();
        MetaQueryLogic = QueryLogic.AllCriteriaMatch;

        KeywordValues = new List<KeywordItem>();
        KeywordQueryLogic = QueryLogic.AllCriteriaMatch;

        LastPublishedDate = DateTime.MinValue;

        **QuerySortField = "ItemTitle";**
        SortType = MetaSortFieldType.STRING;
        SortType = MetaSortFieldType.DATETIME;
        QuerySortOrder = MetaQueryOrder.Ascending;
        MaximumComponents = int.MaxValue;
    }