SortEntryVector class

Applies to Windows and Windows Phone

Provides access to the sorting criteria of the query results as a collection of SortEntry objects.


var sortEntryVector = queryOptions.sortOrder;




The SortEntryVector class has these types of members:


The SortEntryVector class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

Add [C#, VB]
Append [C++, JavaScript]Appends a sort entry to the end of the collection.
Clear Removes all sort entries from the collection.
Contains [C#, VB]
CopyTo [C#, VB]
First [C++, JavaScript]Retrieves an iterator that iterates through the sort entries in the collection.
GetAt [C++, JavaScript]Retrieves the sort entry at the specified index in the collection.
GetMany [C++, JavaScript]Retrieves the sort entries that start at the specified index in the collection.
GetView [C++, JavaScript]Retrieves an immutable view of the collection of sort entries.
IndexOf [C++, JavaScript]Retrieves the index of a specified sort entry in the collection.
IndexOf [C#, VB]
Insert [C#, VB]
InsertAt [C++, JavaScript]Inserts a sort entry into the collection at a specified index.
Remove [C#, VB]
RemoveAt [C++, JavaScript]Removes the sort entry at the specified index in the collection.
RemoveAt [C#, VB]
RemoveAtEnd [C++, JavaScript]Removes the last sort entry from the collection.
ReplaceAll [C++, JavaScript]Replaces all sort entries in the collection with the specified sort entries.
SetAt [C++, JavaScript]Sets the sort entry at the specified index of the collection.



The SortEntryVector class has these properties.

PropertyAccess typeDescription

Count [C#, VB]


IsReadOnly [C#, VB]


Item [C#, VB]


Size [C++, JavaScript]

Read-onlyGets the number of sort entries in the collection.



Note  Although it's not attributed with marshalling_behavior(agile), this class can be treated as agile. For more info, see Threading and Marshaling (C++/CX).

You can retrieve this object using QueryOptions.SortOrder.

Collection member lists

For JavaScript, SortEntryVector has the members shown in the member lists. In addition, SortEntryVector supports a length property, members of Array.prototype, and using an index to access items.

Enumerating the collection in C# or Microsoft Visual Basic

A SortEntryVector is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<SortEntry> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with a SortEntry constraint.


Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]


Windows::Storage::Search [C++]



See also

QueryOptions.SortOrder Property



© 2014 Microsoft