1<?xml version="1.0" encoding="utf-8"?> 2<Type Name="GridViewSortEventArgs" FullName="System.Web.UI.WebControls.GridViewSortEventArgs"> 3 <TypeSignature Language="C#" Value="public class GridViewSortEventArgs : System.ComponentModel.CancelEventArgs" /> 4 <AssemblyInfo> 5 <AssemblyName>System.Web</AssemblyName> 6 <AssemblyVersion>2.0.0.0</AssemblyVersion> 7 </AssemblyInfo> 8 <Base> 9 <BaseTypeName>System.ComponentModel.CancelEventArgs</BaseTypeName> 10 </Base> 11 <Interfaces /> 12 <Docs> 13 <since version=".NET 2.0" /> 14 <remarks> 15 <attribution license="cc4" from="Microsoft" modified="false" /> 16 <para>The <see cref="T:System.Web.UI.WebControls.GridView" /> control raises the <see cref="E:System.Web.UI.WebControls.GridView.Sorting" /> event when a Sort button (a button with its CommandName property set to "Sort") is clicked, but before the <see cref="T:System.Web.UI.WebControls.GridView" /> 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.</para> 17 <block subset="none" type="note"> 18 <para>Although any button within a <see cref="T:System.Web.UI.WebControls.GridView" /> control with its CommandName property set to "Sort" will raise the <see cref="E:System.Web.UI.WebControls.GridView.Sorting" /> event, Sort buttons typically appear in the header row of a <see cref="T:System.Web.UI.WebControls.GridView" /> control.</para> 19 </block> 20 <para>A <see cref="T:System.Web.UI.WebControls.GridViewSortEventArgs" /> 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 <see cref="T:System.Web.UI.WebControls.GridView" /> control. To determine the sort expression, use the <see cref="P:System.Web.UI.WebControls.GridViewSortEventArgs.SortExpression" /> property. To determine the sort direction, use the <see cref="P:System.Web.UI.WebControls.GridViewSortEventArgs.SortDirection" /> property. You can also cancel a sorting operation by setting the <see cref="P:System.ComponentModel.CancelEventArgs.Cancel" /> property to true.</para> 21 <para>For more information about handling events, see <format type="text/html"><a href="01e4f1bc-e55e-413f-98c7-6588493e5f67">Consuming Events</a></format>.</para> 22 <para>For a list of initial property values for an instance of <see cref="T:System.Web.UI.WebControls.GridViewSortEventArgs" />, see the <see cref="M:System.Web.UI.WebControls.GridViewSelectEventArgs.#ctor(System.Int32)" /> constructor.</para> 23 </remarks> 24 <summary> 25 <attribution license="cc4" from="Microsoft" modified="false" /> 26 <para>Provides data for the <see cref="E:System.Web.UI.WebControls.GridView.Sorting" /> event.</para> 27 </summary> 28 </Docs> 29 <Members> 30 <Member MemberName=".ctor"> 31 <MemberSignature Language="C#" Value="public GridViewSortEventArgs (string expression, System.Web.UI.WebControls.SortDirection sortDirection);" /> 32 <MemberType>Constructor</MemberType> 33 <Parameters> 34 <Parameter Name="expression" Type="System.String" /> 35 <Parameter Name="sortDirection" Type="System.Web.UI.WebControls.SortDirection" /> 36 </Parameters> 37 <Docs> 38 <param name="expression">To be added.</param> 39 <since version=".NET 2.0" /> 40 <remarks> 41 <attribution license="cc4" from="Microsoft" modified="false" /> 42 <para>Use this constructor to initialize a new instance of the <see cref="T:System.Web.UI.WebControls.GridViewSortEventArgs" /> class.</para> 43 <para>The following table shows the initial property values for an instance of <see cref="T:System.Web.UI.WebControls.GridViewSortEventArgs" />.</para> 44 <list type="table"> 45 <listheader> 46 <item> 47 <term> 48 <para>Property </para> 49 </term> 50 <description> 51 <para>Initial value </para> 52 </description> 53 </item> 54 </listheader> 55 <item> 56 <term> 57 <para> 58 <see cref="P:System.Web.UI.WebControls.GridViewSortEventArgs.SortDirection" /> 59 </para> 60 </term> 61 <description> 62 <para>The value of the <paramref name="sortDirection" /> parameter.</para> 63 </description> 64 </item> 65 <item> 66 <term> 67 <para> 68 <see cref="P:System.Web.UI.WebControls.GridViewSortEventArgs.SortExpression" /> 69 </para> 70 </term> 71 <description> 72 <para>The value of the <paramref name="sortExpression" /> parameter. </para> 73 </description> 74 </item> 75 </list> 76 <block subset="none" type="note"> 77 <para>This constructor is used primarily by control developers when raising events.</para> 78 </block> 79 </remarks> 80 <summary> 81 <attribution license="cc4" from="Microsoft" modified="false" /> 82 <para>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.GridViewSortEventArgs" /> class.</para> 83 </summary> 84 <param name="sortDirection"> 85 <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Web.UI.WebControls.SortDirection" /> that indicates the direction in which to sort the items in the control.</param> 86 </Docs> 87 <AssemblyInfo> 88 <AssemblyVersion>2.0.0.0</AssemblyVersion> 89 </AssemblyInfo> 90 </Member> 91 <Member MemberName="SortDirection"> 92 <MemberSignature Language="C#" Value="public System.Web.UI.WebControls.SortDirection SortDirection { set; get; }" /> 93 <MemberType>Property</MemberType> 94 <ReturnValue> 95 <ReturnType>System.Web.UI.WebControls.SortDirection</ReturnType> 96 </ReturnValue> 97 <Docs> 98 <value>To be added.</value> 99 <since version=".NET 2.0" /> 100 <remarks> 101 <attribution license="cc4" from="Microsoft" modified="false" /> 102 <para>When the <see cref="E:System.Web.UI.WebControls.GridView.Sorting" /> event is raised, you can use the <see cref="P:System.Web.UI.WebControls.GridViewSortEventArgs.SortDirection" /> property to determine the order in which the <see cref="T:System.Web.UI.WebControls.GridView" /> control will sort its items (based on the sort expression) when the sort operation is performed. Because the <see cref="E:System.Web.UI.WebControls.GridView.Sorting" /> event occurs before the sort operation, you can also use the <see cref="P:System.Web.UI.WebControls.GridViewSortEventArgs.SortDirection" /> property to programmatically set the sort direction.</para> 103 </remarks> 104 <summary> 105 <attribution license="cc4" from="Microsoft" modified="false" /> 106 <para>Gets or sets the direction in which to sort the <see cref="T:System.Web.UI.WebControls.GridView" /> control.</para> 107 </summary> 108 </Docs> 109 <AssemblyInfo> 110 <AssemblyVersion>2.0.0.0</AssemblyVersion> 111 </AssemblyInfo> 112 </Member> 113 <Member MemberName="SortExpression"> 114 <MemberSignature Language="C#" Value="public string SortExpression { set; get; }" /> 115 <MemberType>Property</MemberType> 116 <ReturnValue> 117 <ReturnType>System.String</ReturnType> 118 </ReturnValue> 119 <Docs> 120 <value>To be added.</value> 121 <since version=".NET 2.0" /> 122 <remarks> 123 <attribution license="cc4" from="Microsoft" modified="false" /> 124 <para>When the <see cref="E:System.Web.UI.WebControls.GridView.Sorting" /> event is raised, you can use the <see cref="P:System.Web.UI.WebControls.GridViewSortEventArgs.SortExpression" /> property to determine the sort expression that will be used to sort the <see cref="T:System.Web.UI.WebControls.GridView" /> control when sort operation is performed. By default, the <see cref="T:System.Web.UI.WebControls.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.</para> 125 </remarks> 126 <summary> 127 <attribution license="cc4" from="Microsoft" modified="false" /> 128 <para>Gets or sets the expression used to sort the items in the <see cref="T:System.Web.UI.WebControls.GridView" /> control.</para> 129 </summary> 130 </Docs> 131 <AssemblyInfo> 132 <AssemblyVersion>2.0.0.0</AssemblyVersion> 133 </AssemblyInfo> 134 </Member> 135 </Members> 136</Type>