ListViewSortEventArgs::SortExpression Property

 

Gets or sets the expression that is used to sort the items in the ListView control.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public:
property String^ SortExpression {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

The expression that is used to sort the items in the ListView control.

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.

System_CAPS_noteNote

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.

No code example is currently available or this language may not be supported.

The following example shows how to set the SortExpression property in order to sort multiple columns with different sort directions applied to each column.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5
Return to top
Show: