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;
}