1.Code requires to handle the SortCommand event and rebind grid required.
2.Code requires to handle the PageIndexChanged.
3.Need extensive code for update operation on data.
4.When compared to gridview less events supported.
1.No code required.
2.No code required for PageIndexChanged.
3.Needs little code for update operation.
4.GridView supports events fired before and after database updates
1)Read-only; no inherent support for selection or editing ·
2)No inherent look; you lay out the list by creating templates.
3)List can be vertical, horizontal, all on one line, or in any format you specify. ·
4)No default paging; all data is displayed in a single list. ·
5)Separators between elements can be defined using a template
1)Default look is a grid (customizable table) ·
2)Can customize look of table extensively. ·
3)Options for auto-formatting. ·
4)Can specify output using bound columns, columns of buttons or hyperlinks, and custom
columns created using templates. ·
5)No separator template. However, the grid renders in a table, and you can specify table border size and color. ·
6)WYSIWYG template editing ·
7)Items support styles for custom look. ·
8)Editable contents, including deletion ·
9)Single and multiple selection ·
10)Optional paged output ·Support for sorting ·
11)Support for custom functionality that can be applied to items
Set the Allow Paging to true.In PageIndexChanged event set the current page index clicked.
The DataGrid Web server control is a powerful tool for displaying information from a data source. It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties. At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data.
If you want to customize the content of a column, make the column a template column. Template columns work like item templates in the DataList or Repeater control, except that you are defining the layout of a column rather than a row.
A Datagrid, Datalist and Repeater are all ASP.NET data Web controls.
They have many things in common like DataSource Property, DataBind Method ItemDataBound and ItemCreated.
When you assign the DataSource Property of a Datagrid to a DataSet then each DataRow present in the DataRow Collection of DataTable is assigned to a corresponding DataGridItem and this is same for the rest of the two controls also. But The HTML code generated for a Datagrid has an HTML TABLE <ROW> element created for the particular DataRow and its a Table form representation with Columns and Rows.
For a Datalist it””s an Array of Rows and based on the Template Selected and the RepeatColumn Property value We can specify how many DataSource records should appear per HTML <table> row. In hort in datagrid we have one record per row, but in datalist we can have five or six rows per row.
For a Repeater Control, the Datarecords to be displayed depends upon the Templates specified and the only HTML generated is the due to the Templates.
In addition to these, Datagrid has a in-built support for Sort, Filter and paging the Data, which is not possible when using a DataList and for a Repeater Control we would require to write an explicit code to do paging.