Summary

In this hour we examined how to create a sortable DataGrid. The sortable DataGrid allows the user to sort the data in the DataGrid according to a particular column by clicking the column's hyperlink header.

In order to make a sortable DataGrid, we, the developers, must undertake a number of steps. The first step is simply to add the DataGrid to the ASP.NET Web page. Next we have to specify that the DataGrid should be sortable by checking the “Allow sorting” checkbox in the DataGrid's Property Builder.

Next we need to create a function that takes an input parameter that specifies by which column the database data should be sorted. To assist in creating this function, we can use the SELECT Data Method Code Builder and then modify the source ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.