The Difference Between a DataGrid and a GridView in ASP.NET?
DataGrid was an ASP.NET 1.1 control, still supported. GridView arrived in 2.0, made certain tasks simpler added different databinding features:
This link has a comparison of DataGrid and GridView features -
https://msdn.microsoft.com/en-us/library/05yye6k9(v=vs.100).aspx
The GridView
control is the successor to the DataGrid
control. Like the DataGrid
control, the GridView
control was designed to display data in an HTML table. When bound to a data source, the DataGrid
and GridView
controls each display a row from a DataSource
as a row in an output table.
Both the DataGrid
and GridView
controls are derived from the WebControl
class. Although it has a similar object model to that of the DataGrid
control, the GridView control also has a number of new features and advantages over the DataGrid
control, which include:
- Richer design-time capabilities.
- Improved data source binding capabilities.
- Automatic handling of sorting, paging, updates, and deletes.
- Additional column types and design-time column operations.
- A Customized pager user interface (UI) with the PagerTemplate property.
Differences between the GridView
control and the DataGrid
control include:
- Different custom-paging support.
- Different event models.
Sorting, paging, and in-place editing of data requires additional coding when using the DataGrid
control. The GridView
control enables you to add sorting, paging, and editing capabilities without writing any code. Instead, you can automate these tasks, along with other common tasks such as data binding to a data source, by setting properties on the control.