Export (0) Print
Expand All

GridView.Sorted Event

Occurs when the hyperlink to sort a column is clicked, but after the GridView control handles the sort operation.

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

member Sorted : IEvent<EventHandler,
    EventArgs>
<asp:GridView OnSorted="EventHandler" />

The Sorted event is raised when the hyperlink to sort a column is clicked, but after the GridView control handles the sort operation. This enables you to provide an event-handling method that performs a custom routine, such as custom sorting, whenever this event occurs.

For more information about handling events, see Consuming Events.

The following example demonstrates how to use the Sorted event to display the name of the column being sorted.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft