Beispiel #1
0
        private void showHistoryList_OnColumnClick(Object sender, ColumnClickEventArgs e)
        {
            if (!(showHistoryList.ListViewItemSorter is ListViewSorter))
            {
                return;
            }
            Sorter = (ListViewSorter)showHistoryList.ListViewItemSorter;

            if (Sorter.SortColumn == e.Column)
            {
                if (Sorter.Order == SortOrder.Ascending)
                {
                    Sorter.Order = SortOrder.Descending;
                }
                else
                {
                    Sorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                Sorter.Order = SortOrder.Descending;
            }
            Sorter.SortColumn = e.Column;

            showHistoryList.Sort();
        }
        private void eventList_OnColumnClick(Object sender, ColumnClickEventArgs e)
        {
            if (!(eventList.ListViewItemSorter is ListViewSorter))
                return;
            Sorter = (ListViewSorter)eventList.ListViewItemSorter;

            if (Sorter.SortColumn == e.Column)
            {
                if (Sorter.Order == SortOrder.Ascending)
                    Sorter.Order = SortOrder.Descending;
                else
                    Sorter.Order = SortOrder.Ascending;
            }
            else
            {
                Sorter.Order = SortOrder.Descending;
            }
            Sorter.SortColumn = e.Column;

            eventList.Sort();
        }