Example #1
0
        private void SortColumn(DataGridViewColumn e)
        {
            DataGridViewColumn column = e;

            if (_lastHeaderClicked != column.Name)
            {
                _sortReverse = false;
            }

            var direction = !_sortReverse
                                ? ListSortDirection.Ascending
                                : ListSortDirection.Descending;

            CommentGrid.Sort(column, direction);
            _lastHeaderClicked = column.Name;
            _sortReverse       = !_sortReverse;
            CommentGrid.Refresh();
        }
Example #2
0
        private void SortColumn(DataGridViewColumn e)
        {
            ListSortDirection  _direction;
            DataGridViewColumn _column = e;

            if (_lastHeaderClicked != _column.Name)
            {
                _sortReverse = false;
            }
            if (!_sortReverse)
            {
                _direction = ListSortDirection.Ascending;
            }
            else
            {
                _direction = ListSortDirection.Descending;
            }
            CommentGrid.Sort(_column, _direction);
            _lastHeaderClicked = _column.Name;
            _sortReverse       = !_sortReverse;
            CommentGrid.Refresh();
        }