Home > DeveloperSection > Forums > Sorting
Pawan kumar
Pawan kumar

Total Post:19

Posted on    May-05-2011 4:34 AM

 ASP.Net ASP.Net 

 1 Reply(s)
 980  View(s)
Rate this:

Sir i want to applying sorting a columns or more than one columns in GridView.and how add  the images of  ascending and decending order in the columns.

so how i manage sorting on gridview

Amit Singh

Total Post:103

Posted on    May-05-2011 8:54 AM

hi, pawan

we sort the column in gridview
set the allowsorting property of gridview is true
and we use the sortexpression properties in boundfield tag
for example
<asp:gridview runat="server" AllowSorting="true">
<asp:BoundField datafield="username" HeaderText="User Name" SortExpression="username"/>
and so on..
and bind the data in gridview in sort order by using the query in asc or desc or set the Allowsorting property of grid view is true and use many other way.

Don't want to miss updates? Please click the below button!

Follow MindStick