he DataGrid control is one of the most powerful controls in ASP.NET 1.x. It's highly customizable and most Web developers are familiar with it. However, although the DataGrid control is still supported in ASP.NET 2.0, it requires too much work for mundane tasks such as sorting the rows based on columns, editing or deleting rows, etc.
|Figure 1. The Controls: The GridView and DetailsView controls under the Data tab in the Toolbox.|
In this latest release of ASP.NET, the GridView control further enhances the flexibility of the previous DataGrid control. This article shows how to use the GridView control and demonstrates how it reduces the amount of code you need to write. In fact, for the examples in this article, there is no code to write! You will also learn a bit about GridView's companion control, DetailsView.
Figure 1 shows the GridView and DetailsView controls found under the Data tab in the Toolbox.