예제 #1
0
        private void Lv_BillingReportList_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            ListView listView = (ListView)sender;
            int      column   = 0; //e.Column; // 0 = only sort name column

            ListViewSorter Sorter = new ListViewSorter();

            listView.ListViewItemSorter = Sorter;
            if (!(listView.ListViewItemSorter is ListViewSorter))
            {
                return;
            }
            Sorter = (ListViewSorter)listView.ListViewItemSorter;

            if (Sorter.LastSort == column)
            {
                if (listView.Sorting == SortOrder.Ascending)
                {
                    listView.Sorting = SortOrder.Descending;
                }
                else
                {
                    listView.Sorting = SortOrder.Ascending;
                }
            }
            else
            {
                listView.Sorting = SortOrder.Descending;
            }
            Sorter.ByColumn = column;

            listView.Sort();
        }
예제 #2
0
        private void Lv_BillingReportList_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            ListView listView = (ListView)sender;
            int column = 0; //e.Column; // 0 = only sort name column

            ListViewSorter Sorter = new ListViewSorter();
            listView.ListViewItemSorter = Sorter;
            if (!(listView.ListViewItemSorter is ListViewSorter))
            {
                return;
            }
            Sorter = (ListViewSorter)listView.ListViewItemSorter;

            if (Sorter.LastSort == column)
            {
                if (listView.Sorting == SortOrder.Ascending)
                {
                    listView.Sorting = SortOrder.Descending;
                }
                else
                {
                    listView.Sorting = SortOrder.Ascending;
                }
            }
            else
            {
                listView.Sorting = SortOrder.Descending;
            }
            Sorter.ByColumn = column;

            listView.Sort();

        }