
To display and modify data in our Asp.Net web application, we can use Data-bound controls such as Repeater, DataList and GridView. All these three Data-bound controls are bounded to data source control such as LinqDataSource and SqlDataSource. These control also contain some other basic Asp.net control which includes DropdownList, Labels, Textbox, etc.
Difference Between Repeater, DataList and GridView
Here in this article, you will learn all the difference between DataList, Repeater and GridView.
DataList vs Repeater: Head to Head Comparison
DataList | Repeater |
Object Rendering | |
Its object rendered as a table | It uses templates to render its object. |
Columns generation | |
It automatically generates columns using the data source. | It cannot generate columns. |
Row selection | |
It can select a row from the data source. | It cannot select rows. |
Content Editing | |
Using DataList control, we can edit object content. | It does not support content editing. |
Data arrangement | |
It has RepeatDirection property which allows it to arrange data vertically and horizontally. | It cannot manually arrange data. |
Performance | |
It is slower than Repeater. | It is very fast because of its lightweight. |
GridView vs Repeater: Head to Head Comparison
GridView | Repeater |
Debut | |
GridView was introduced in Asp.Net 2.0 | The Repeater was introduced in Asp.Net 1.0. |
Columns generation | |
It automatically generates columns using the data source. | It cannot generate columns. |
Row selection | |
It can select a row from the data source. | It cannot select rows. |
Content Editing | |
Using GridView control, we can edit object content. | It does not support content editing. |
In-built methods | |
It comes with built-in paging and sorting methods. | No built-in support for Built-in paging and sorting developer has to code. |
Auto formatting and styling | |
In GridView we get inbuilt auto format and styling feature. | It does not support these features. |
Performance | |
It is slower than Repeater. | Because of its lightweight, it is faster as compared to GridView. |
GridView vs DataList: Head to Head Comparison
GridView | DataList |
Debut | |
GridView was introduced in Asp.Net 2.0 version. | DataList was introduced in Asp.Net 1.0 version. |
In-built methods | |
It comes with built-in paging and sorting methods. | No built-in support for Built-in paging and sorting, the developer has to code for these features. |
Build-in CRUD operation | |
It comes with built-in Update and Deletes Operations, so the developer does not need to write code for simple operations. | If developer use DataList then he/she has to write code for the Update and Delete operations. |
Auto formatting and styling | |
In GridView we get inbuilt auto format and styling feature. | It does not support these features. |
Customizable Row | |
We do not get Customizable row separator feature in GridView. | DataList has SeparatorTemplate for customizable row separator. |
Performance: | |
Its performance is the lowest as compared to Repeater and DataList. | It is faster than the GridView. |
Conclusion
In this tutorial, you learned all the basic and advance difference between Repeater, DataList and GridView. You can choose any of these Data-bound controls according to your application need. All these three controls can be used to show the collection of records.
The GridView Provide more features as compared to repeaters and DataList, and it even makes the code implementation faster. But it comes with a price of slow loading. However, DataList and Repeaters lack in built-in features, but they are more customizable and faster.
People are also reading:
- Difference between Float and Double
- Difference between Stack and Heap
- Difference between Union vs Structure
- What is the Python Data Structure?
- Matrix Multiplication in C
- Difference between List vs Array
- What is Functional Programming?
- What is Structure Programming?
- Top Data Structure Interview Questions