Hi all, I just have curiosity about something that I read in a book " Unlike using the DataGrid, where you are responsible for
coding the sort routine, to enable column sorting in this grid, you just set the AllowSorting attribute to
True. The control takes care of all the sorting logic for you internally
"
and i want to make sure that work for somebody here, because i did try it and told me that the sort procedure is missing, which mean still i have to write some codes to handle the sort feature. anyway i just want to know if that is possible of course i would like to try it.

thanks all. regards.

Recommended Answers

All 2 Replies

The automatic sorting feature will work only if you bind the GridView with DataSource controls like SqlDataSource and ObjectDataSource. These controls automatically take care binding data with GridView. Therefore the sorting feature also handled automatically by them.

If you bind the GridView with a DataSet , then you need to call DataBind() explicitly method to bind the data source . Therefore you need to write the code to provide sorting feature.

Got it!!! thanks for your comment.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.