コード例 #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
ファイル: MainForm.cs プロジェクト: bsimser/goldbox
        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();
        }