[]
Sorts a list based on a property name and sort direction.
public static void Sort(IDataList list, string name, bool ascending = true)
Type | Name | Description |
---|---|---|
IDataList | list | A list of items that implements the IDataList interface. |
string | name | The name of the property to sort by. |
bool | ascending | A value that indicates whether the sort order is ascending. |
This method can be called multiple times on the same list to specify secondary sort criteria. However, the ascending
parameter must be the same for each call.
Call this method to set sort criteria before calling CreateFromDataList(IDataList, string)