Duration: 20 minutes
Summary: In this video, we proceed with our GridView discussion. We talk about sorting columns in a grid; then we add Ajax to the mix. So first, we create a grid that retrieves data from the Contact table. We see that the grid does not allow sorting by default. We turn sorting on (AllowSorting=true), and we see how the columns turn sortable. We can sort, text, numbers, dates… We sort in ascending and descending orders. After that, we create another sortable grid, but in this case, we add Ajax support. In many situations you will have a lot more than a grid on the page, and when sorting the whole page will be posted back to the server and refreshed. To avoid this performance hit we placed the grid in an UpdatePanel. That way, when sorting (or doing anything that requires the grid to refresh) only the content of the grid are changed. The other parts of the page are not affected, and the post back does not take place.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: ASP.NET and Visual Studio 2010
Keyword: ASP.NET 4, Visual Studio 2010, GridView, AllowSorting, SqlDataSource, ScriptManager, UpdatePanel, ContentTemplate, ConnectionString.