ListViewSortEventArgs::SortExpression Property
Gets or sets the expression that is used to sort the items in the ListView control.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
When the Sorting event is raised, you can use the SortExpression property to specify the sort expression that will be used to sort the ListView control. The sort expression contains the name of the field to sort. You can also sort multiple columns at a time by programmatically setting this property to a comma-separated list of field names.
Note |
|---|
By default, the ListView control applies the sort direction to the complete list of columns. As a result, the sort direction applies to only the last column in the list. |
The following example shows how to use the ListViewSortEventArgs object to display the sort direction and the column being sorted. This code example is part of a larger example provided for the ListViewSortEventArgs class.
The following example shows how to set the SortExpression property in order to sort multiple columns with different sort directions applied to each column.
Available since 3.5
