System.Web 2.0.0.0 System.ComponentModel.CancelEventArgs

The control raises the event when a Sort button (a button with its CommandName property set to "Sort") is clicked, but before the control handles the sort operation. This allows you to provide an event-handling method that performs a custom routine, such as canceling the sorting operation, whenever this event occurs.

Although any button within a control with its CommandName property set to "Sort" will raise the event, Sort buttons typically appear in the header row of a control.

A object is passed to the event-handling method, which allows you to specify or determine the sort expression and sort direction in which to sort the control. To determine the sort expression, use the property. To determine the sort direction, use the property. You can also cancel a sorting operation by setting the property to true.

For more information about handling events, see Consuming Events.

For a list of initial property values for an instance of , see the constructor.

Provides data for the event.

- Constructor
  To be added.

  Use this constructor to initialize a new instance of the class.

  The following table shows the initial property values for an instance of .

  Property

  Initial value

  The value of the parameter.

  The value of the parameter.

  This constructor is used primarily by control developers when raising events.

  Initializes a new instance of the class.

  A that indicates the direction in which to sort the items in the control.
  2.0.0.0
- Property
  System.Web.UI.WebControls.SortDirection To be added.

  When the event is raised, you can use the property to determine the order in which the control will sort its items (based on the sort expression) when the sort operation is performed. Because the event occurs before the sort operation, you can also use the property to programmatically set the sort direction.

  Gets or sets the direction in which to sort the control.

  2.0.0.0
- Property
  System.String To be added.

  When the event is raised, you can use the property to determine the sort expression that will be used to sort the control when sort operation is performed. By default, the 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.

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

  2.0.0.0