System.Web.UI.WebControls.GridView.Sort C# (CSharp) Method

Sort() private method

private Sort ( string newSortExpression ) : void
newSortExpression string
return void
		void Sort (string newSortExpression)
		{
			SortDirection newDirection = SortDirection.Ascending;
			if (sortExpression == newSortExpression && sortDirection == SortDirection.Ascending)
				newDirection = SortDirection.Descending;

			Sort (newSortExpression, newDirection);
		}
		

Same methods

GridView::Sort ( string newSortExpression, SortDirection newSortDirection ) : void

Usage Example

        /// <summary>
        /// Restores the state of the grid view and grid view search panel.
        /// </summary>
        /// <param name="gridView">The grid view.</param>
        /// <param name="searchPanel">The search panel.</param>
        public void RestoreState( ref GridView gridView, ref GridViewSearchPanel searchPanel )
        {
            gridView.PageIndex = this.PageIndex;
            gridView.PageSize = this.PageSize;  

            searchPanel.SearchFieldName = this.SearchFieldName;
            searchPanel.SearchKeyword = this.SearchKeyword;
            searchPanel.SearchOperator = this.SearchOperator;
            searchPanel.Filter = this.Filter;

            if (!string.IsNullOrEmpty(this.SortExpression))
            {
                gridView.Sort(this.SortExpression, this.SortDirection);
            }
        }
All Usage Examples Of System.Web.UI.WebControls.GridView::Sort