Xuni Product Documentation - iOS
Sorting

Xuni iCollectionView interface supports ascending and descending sorting for data controls, such as FlexGrid. To enable sorting, add one or more XuniSortDescription objects to the CollectionView.sortDescriptions property. To sort columns at runtime, You can simply tap the column header to sort that particular column of the FlexGrid control. Make sure that the FlexGrid's allowSorting property is set to true (the default value).

XuniSortDescription objects are flexible, they allow you to add objects for individual columns, and set their sorting order to ascending or descending. Note that in the example below, CustomerID column is set to sort in descending order.

The image below shows how the FlexGrid appears, after these properties have been set.

The following code examples demonstrate how to set this property in Objective-C. These examples use the sample created in the Quick Start section.

In Code

Objective-C
Copy Code
//Enable grid sorting.
flex.allowSorting=true;
XuniSortDescription *sd = [[XuniSortDescription alloc] initWithProperty:@"customerID" ascending:false];
flex.itemsSource = [CustomerData getCustomerData:10];
[flex.collectionView.sortDescriptions addObject:sd];

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback