Provides a way to apply a sort expression to an IQueryable object.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Gets or sets the property of the IQueryable object to sort by.
Gets the data source object that is associated with the owner control.(Inherited from DataSourceExpression.)
Gets and sets the sort direction of the IQueryable data source object.
Gets a value that indicates whether a data source expression object is tracking its view state changes.(Inherited from DataSourceExpression.)
Gets the owner control.(Inherited from DataSourceExpression.)
Gets or sets the collection of ThenBy expressions to apply after an value is applied to the data source.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
|SetContext(Control, HttpContext, IQueryableDataSource)|
Returns a string that represents the current object.(Inherited from Object.)
When implemented by a class, loads the previously saved view state of the data source expression object.(Inherited from DataSourceExpression.)
When implemented by a class, gets a value that indicates whether a data source expression object is tracking its view state changes.(Inherited from DataSourceExpression.)
The QueryExtender control to sort data in ascending or descending order. The sorting is performed by the default comparer for the type of the element.class is used in the
The QueryExtender control supports a variety of options that you can use to filter data. After you use the filter options, you can use the object to sort the data.
You specify the data field to sort by using the DataField property. You specify the sort direction by using the Direction property. After the object has been applied to the data source, you can use the ThenBy expressions to perform a subsequent sort on another data field.
The following example shows how to search the Products table of the AdventureWorks database for products that have names that start with the string that is specified in the SearchTextBox text box. The object sorts the data by the ListPrice data field in descending order and then by the product ID field in ascending order. The result of the query that is returned from the LinqDataSource control is displayed in a GridView control.
This code example is part of a larger example that is provided in Walkthrough: Filtering Data in a Web Page Using Declarative Syntax.
Available since 4.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.