DataGrid, GridView, DataList and Repeater Control in ASP.net

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:

  1. Displays data as a table
  2. Updateable
  3. Item as row
  4. Control over
  • Alternate item
  • Header
  • Footer
  • Colors, font, borders, etc.
  • Paging

Features of Repeater:

  1. List format
  2. No default output
  3. More control
  4. More complexity
  5. Item as row
  6. Not updateable

Features of DataList:

  1. Directional rendering
  2. Good for columns
  3. Item as cell
  4. Alternate item
  5. 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.

Posted

in

by


Related Posts

Comments

5 responses to “DataGrid, GridView, DataList and Repeater Control in ASP.net”

  1. wen informer Avatar
    wen informer

    is that right Performance wise Repeater is more far better than Gridview But Features wise Gridview is better

  2. Roshani Avatar

    Yes wen, You are right.
    Nice comparison between controls.

  3. prajesh Avatar
    prajesh

    how can we add gridview in repeater

    1. Jitendra Zaa Avatar

      Hi Prajesh,
      Please refer this article – http://www.codeproject.com/KB/database/repeater_in_gridview.aspx

      Regards,
      Jitendra Zaa

  4. Mukesh Kumar Bhagat Avatar
    Mukesh Kumar Bhagat

    how to show datalist control on click of link button control inside gridview.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading