private void FileListViewColumnClick(object sender, ColumnClickEventArgs e) { var sorter = new ListViewSorter(); fileView.ListViewItemSorter = sorter; sorter = (ListViewSorter)fileView.ListViewItemSorter; if (sorter.LastSort == e.Column) { fileView.Sorting = fileView.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending; } else { fileView.Sorting = SortOrder.Descending; } sorter.ByColumn = e.Column; fileView.Sort(); }
private void FileListViewColumnClick(object sender, ColumnClickEventArgs e) { var sorter = new ListViewSorter(); fileView.ListViewItemSorter = sorter; sorter = (ListViewSorter) fileView.ListViewItemSorter; if (sorter.LastSort == e.Column) { fileView.Sorting = fileView.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending; } else { fileView.Sorting = SortOrder.Descending; } sorter.ByColumn = e.Column; fileView.Sort(); }