DataGrid.AllowSorting Property
.NET Framework 3.0
Gets or sets a value that indicates whether sorting is enabled.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
/** @property */ public boolean get_AllowSorting () /** @property */ public void set_AllowSorting (boolean value)
public function get AllowSorting () : boolean public function set AllowSorting (value : boolean)
Not applicable.
Property Value
true if sorting is enabled; otherwise, false. The default value is false.When sorting is enabled, LinkButton controls are rendered in the heading section of each column where the SortExpression property is set. These LinkButton controls allow you to sort the DataGrid control by the selected column. The only exception is when you use a TemplateColumn column type with the HeaderTemplate property set. In this case, you must provide a Button control in the HeaderTemplate of the column.
The SortCommand event is raised when one of the LinkButton controls is clicked. It is up to you to provide code for the event handler. The typical logic for the handler is to sort the list, and then rebind the data to the DataGrid control.
Community Additions
ADD
Show: