Telling the list to sort when created

The easiest way to sort a list control is by telling the list control in the constructor to sort items. You do this by using one of the style flags wx.lc_sort_ascending or wx.lc_sort_descending. This flag causes the list to be sorted when initially displayed, and on MS Windows, the sorting continues to be honored when new items are added. The sort is based on the string text for each list item's data, and is a simple string comparison. If the list is in report mode, the sort is based on the string in column 0 (the left-most column) of each row.

Was this article helpful?

0 0

Post a comment