How to: Sort Data (Runtime Sample)

This document describes how to sort Snap list data in code. To learn how to accomplish this task by using the Snap graphical user interface, see the Sort Document Data topic.

The following method sorts data records in a Snap list, by creating a SnapListGroupParam with the specified criteria and order, and adding it to the SnapList.Sorting collection.

using DevExpress.Data;
using DevExpress.Snap.Core.API;
// ...
        private void SortList(SnapList list) {
            list.Sorting.Add(new SnapListGroupParam("UnitPrice", ColumnSortOrder.Descending));
        }
See Also