This documentation is archived and is not being maintained.

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.

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.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Show: