Hi All !
I am back !!!
Difference between DataGrid and GridView:
In .Net 2.0, we are using GridView. Since DataGrid and GridView are same we have some extra facilities and features in GridView than DataGrid.
By using GridView we can render it on Mobile Devices also, but DataGrid only use for web pages. Another key difference between DataGrid and GridView controls lies in the adaptive user interface.
In DataGrid paging, sorting, inserting, updating and deleting are implementing by coding. But in GridView automatically generates those things without user writing the code.
Sorting: In DataGrid code requires handling the SortCommand event and rebind grid required. In case of GridView no additional code required.
Paging: In DataGrid requires code to handle the PageIndexChanged event and rebind grid required. In case of GridView no additional code required. It also supports customized appearance.
Data binding: Like GridView DataGrid cannot bind with new datasource control in ASP.NET 2.0.
Updating data: DataGrid requires extensive code to update operation on data. GridView requires little code. Code like exceptions handling for database part.
Events: GridView supports events fired before and after database updates. In DataGrid fewer events supported as compared to GridView.
In DataGrid no image template column, whereas GridView have image template column
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.