IN GRIDVIEW CONTROL AS DEFAULT IT HAS PAGING OPTION
Features of a GridView
•Displays data as a table
–Colors, font, borders, etc.
•Item as row
Features of Repeater
•No default output
•Item as row
Be in first....
but don't feel for being last
Check out these articles, this clearly explains about the difference between
It contains Header Template, Item template , alternate
Item template and footer template . it can't support
Selection, editing, sorting and paging. this is read only
<%@ Import Namespace="System.Data" %>
if Not Page.IsPostBack then
dim mycdcatalog=New DataSet
<asp:Repeater id="cdcatalog" runat="server">
<table border="1" width="100%">
DataGrid(or GridView) :
It contains Header Template, Item template , alternate Item
template , Edit itm template and footer template . it can
support selection, editing , sorting and paging . Mostly
every developer caught used this control .
With gridview we can have these:
which displays data as a table, Items as row, we can give Header,Footer to data.
We can format the data based on your condition Colors, font, borders, etc.
We can go with Paging, filtering, sorting.
Main difference is DataGrid control allows you to select, sort, and edit the items.
With Repeater we can have these:
List format, No default output,More complexity,Item as row.
For repeater more control over html generation is required than gridview.
Hope this will give some idea.
Never lose hope..You never know what tomorrow will bring
2) Repeater cannot automatically generates columns from the data source, where as DataList and GridView can.
3) Repeater and DataList supports customizable row separator, where as GridView does not support this feature.
4) Sorting and Paging is only allowed in GridView and not in Repeater and DataList.
5) Selection of row is supported by DataList and GridView and not by Repeater.
6) Editing of contents is supported by DataList and GridView and not by Repeater.
7) We can arrange data items horizontally or verticlaly in DataList, where as this feature is not supported by Repeater and GridView.
Thanks & Regards
Microsoft MVP (ASP.Net/IIS)
Both controls(repeater and GridView) are used to display the data.
Repeater does not support Selection, Editing, Sorting and Paging of the data while the GridView supports all these.
Repeater can display single record at a time while GridView can show many items.
Repeater is used only to display the data not to modify as it is read only but using GridView we can edit, insert, Update and delete the data inside the GridView.
Repeater is fast but GridView is slow.
Hope it will give you enough idea about the differences.
Pawan Awasthi(DNS MVM)
+91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
The Repeater control allows you to create templates to define the layout of its content. The templates are:
>>ItemTemplate — Use this template for elements that are rendered once per row of data.
>>AlternatingItemTemplate — Use this template for elements that are rendered every other row of data. This allows you to alternate background colors, for example.
>>HeaderTemplate — Use this template for elements that you want to render once before your ItemTemplate section.
>>FooterTemplate — Use this template for elements that you want to render once after your ItemTemplate section.
>>SeperatorTemplate — Use this template for elements to render between each row, such as line breaks.
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.