In Previous articles, i have written article about DataGrid.
https://jitendrazaa.com/blog/microsoft/net/datagrid-example-part-1/
https://jitendrazaa.com/blog/microsoft/net/datagrid-example-sorting-%E2%80%93-part-2/
https://jitendrazaa.com/blog/microsoft/net/asp-net-datagrid-basic-questions/
DataGrid, GridView and DataList controls are derived from the WebControl class, while the Repeater control is derived from the Control class. The WebControl class contains a number of properties, such as BackColor, ForeColor, CssClass, BorderStyle and so on.
In ASP .NET basically there are four kinds of the Data Presentation Controls.
- GridView (more options)
- DataGrid
- DataList
- Repeater (less options)
List of different abilities of Repeater Control, Datalist Control and GridView Control features.
Features of a GridView and DataGrid:
- Displays data as a table
- Updateable
- Item as row
- Control over
- Alternate item
- Header
- Footer
- Colors, font, borders, etc.
- Paging
Features of Repeater:
- List format
- No default output
- More control
- More complexity
- Item as row
- Not updateable
Features of DataList:
- Directional rendering
- Good for columns
- Item as cell
- Alternate item
- Updateable
Difference between GridView, Datagrid, DataList and Data Repeater:
- Please visit here, to get difference between Gridview and DataGrid.
- Datagrid has paging while Datalist doesnt.
- Datalist has a property called repeat. Direction = vertical/horizontal. (This is of great help in designing layouts). This is not there in Datagrid.
- A repeater is used when more intimate control over html generation is required.
- When only checkboxes/radiobuttons are repeatedly served then a checkboxlist or radiobuttonlist are used as they involve fewer overheads than a Datagrid.
The Repeater repeats a layout of HTML you write, it has the least functionality of the three. DataList is the next step up from a Repeater; accept you have very little control over the HTML that the control renders. DataList is the first of the three controls that allow you Repeat-Columns horizontally or vertically. Finally, the DataGrid is the motherload. However, instead of working on a row-by-row basis, you’re working on a column-by-column basis. DataGrid caters to sorting and has basic paging for your disposal. Again you have little contro, over the HTML. NOTE: DataList and DataGrid both render as HTML tables by default.
Leave a Reply