---
title: "Sorting"  
description: "Sorting"  
author: "Pawan kumar"  
published: 2011-05-05  
updated: 2011-05-05  
canonical: https://www.mindstick.com/forum/235/sorting  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Sorting

Sir i want to applying [sorting](https://www.mindstick.com/articles/1581/sorting-list-with-side-bar) a columns or more than one columns in [GridView](https://www.mindstick.com/articles/873/update-delete-edit-gridview-in-asp-dot-net).and how [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) the [images](https://www.mindstick.com/interview/1067/what-is-the-php-predefined-variable-that-tells-the-what-type-of-images-that-php-support) of ascending and decending [order](https://www.mindstick.com/articles/12276/how-timely-order-deliveries-can-improve-customer-experience) in the columns.

so how i manage sorting on gridview

## Replies

### Reply by Amit Singh

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"><columns><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.\


---

Original Source: https://www.mindstick.com/forum/235/sorting

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
