What is Gridview ,Details View,Fromviews,Repeater,Datalist Controles in ASP.Net

DataGrid 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 aesthetic properties, such as BackColor, ForeColor, CssClass, BorderStyle and so on.

GridView Control:

The GridView control displays data as a table and provides the capability to sort columns, page through data, and edit or delete a single record. the GridView control offers improvements such as the ability to define multiple primary key fields, improved user interface customization using bound fields and templates, and a new model for handling or canceling events

DetailsView Control:
The DetailsView control renders a single record at a time as a table and provides the capability to page through multiple records, as well as to insert, update, and delete records. The DetailsView control is often used in master-detail scenarios where the selected record in a master control such as a GridView control determines the record displayed by the DetailsView control.

FormView Control:
The FormView control renders a single record at a time from a data source and provides the capability to page through multiple records, as well as to insert, update, and delete records, similar to the DetailsView control. However, the difference between the FormView and the DetailsView controls is that the DetailsView control uses a table-based layout where each field of the data record is displayed as a row in the control. In contrast, the FormView control does not specify a pre-defined layout for displaying a record. Instead, you create templates that contain controls to display individual fields from the record. The template contains the formatting, controls, and binding expressions used to lay out the form.

Repeater Control:
The Repeater control renders a read-only list from a set of records returned from a data source. Like the FormView control, the Repeater control does not specify a built-in layout. Instead you create the layout for the Repeater control using templates.

DataList Control:
The DataList control renders data as table and enables you to display data records in different layouts, such as ordering them in columns or rows. You can configure the DataList control to enable users to edit or delete a record in the table. The DataList control differs from the Repeater control in that the DataList control explicitly places items in an HTML table, where as the Repeater control does not.

Difference between Datagrid,DataList and Data Repeater:
  • 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.
Tags: , , , , , ,
Hot on Web:


About author