Пример #1
0
        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();
        }
Пример #2
0
        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();
        }