Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GridViewSortEventArgs::SortExpression Property

 

Gets or sets the expression used to sort the items in the GridView control.

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

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

Property Value

Type: System::String^

The expression used to sort the items in the GridView control.

When the Sorting event is raised, you can use the SortExpression property to determine the sort expression that will be used to sort the GridView control when sort operation is performed. By default, the GridView control sorts a single column at a time. The sort expression simply 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.

The following example demonstrates how to use the SortExpression property to determine which column in a GridView control is being sorted. If the user attempts to sort the address column, the sort operation is canceled.

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

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft