Articles → ASP .NET GRIDVIEW → Sorting In Asp.Net Gridview
Sorting In Asp.Net Gridview
Click to Enlarge
Bind Gridview With Data
<asp:GridView ID="gvTest" runat="server" DataSourceID="dsTest" ></asp:GridView>
<asp:SqlDataSource ConnectionString="conn_string" ID="dsTest"
SelectCommand="Select * from Member" runat="server" />
Add Property For Sorting
<asp:GridView ID=”gvTest” runat=”server” DataSourceID=”dsTest" AllowSorting="true"></asp:GridView>
<asp:SqlDataSource ConnectionString="conn_string" ID="dsTest"
SelectCommand="Select * from Member" runat="server" />
Output
Click to Enlarge