Comparing ListView with GridView,DataList and Repeater

The ListView control is a new data presentation control that was added in ASP.Net 3.5.You may wonder why its added to the framework , and what it provide .

From what i have seen, ListView control was added to provide The following functionalities :

  1. A very flexible and customizable layout.
  2. A built in data paging support with the new DataPager control.
  3. Support data grouping (repeating items) in a flexible way.
  4. Built in support for deleting,inserting,paging,sorting,and updating the data.

Now , to compare the ListView control with the dataList,GridView and repeater control , lets look at the table below :


Supported Funcationalities
Control Paging Data Grouping Provide Flexible Layout Update,Delete Insert Sorting
ListView supported supported supported supported supported supported
GridView supported Not supported Not Supported supported Not Supported supported
DataList Not supported supported supported Not supported Not supported Not supported
Repeater Not supported Not supported supported Not supported Not supported Not supported

* Supported: means that it's provided out of the box without any custom code or hacks.

* Not Supported: means that it's not provided out of the box by the control but it could be possible to implement it using custom code \ hacks.

The GridView : it supports paging but it doesn't provide a flexible layout , since its mainly used to display the data in a table based layout.And If we looked at data inserting , the Gridview doesn't have a built in support for inserting data( since it doesn't call the insert method of it underlying data source when you click on a button with a CommadName set to "Insert" ).

The DataList : it support data grouping ( through its RepeatColumns property) , but it doesn't have a built in support for paging,inserting ,deleting , updating the data. and if you looked at its laout , you will find that by default  the datalist renders as html table and you will have to set its flowLayout to "Flow" to stop that behaviour.

The Repeater control : you will find that it provides a flexible layout but it doesn't support data grouping ,inserting,deleting , updating  and paging through the data .

 

Summary :

The ListView control was added to provide a rich data control that can support all the required functionalities at the same time , so now you can easily display a fully customizable layout that supports Grouping,paging , inserting , deleting , updating and sorting the data.

 

Anas Ghanem

Published Saturday, September 6, 2008 4:02 PM by anas
Filed under:

Comments

# re: Comparing ListView with GridView,DataList and Repeater

Monday, September 8, 2008 12:39 AM by kamii47

Nice One,

It could be nice if there could be a column for Sort is also included so that we can guess what about support of sorting in each type control

# re: Comparing ListView with GridView,DataList and Repeater

Monday, September 8, 2008 2:12 PM by anas

kamii47

>>"It could be nice if there could be a column for Sort "

Thanks , I added the sorting to the  table .

# re: Comparing ListView with GridView,DataList and Repeater

Thursday, October 23, 2008 4:21 PM by fr3dr1k

Is the data grouping like a nested control?

# re: Comparing ListView with GridView,DataList and Repeater

Saturday, November 15, 2008 12:11 PM by Richard Waddell

Nice, just what I was looking for.

# re: Comparing ListView with GridView,DataList and Repeater

Wednesday, March 18, 2009 9:04 AM by maifs

nice work.

# re: Comparing ListView with GridView,DataList and Repeater

Wednesday, March 18, 2009 9:30 AM by maifs

very nice

# re: Comparing ListView with GridView,DataList and Repeater

Saturday, October 17, 2009 4:12 PM by exsl

Thanks, this is a very useful overview.

# re: Comparing ListView with GridView,DataList and Repeater

Sunday, October 25, 2009 11:14 PM by OldGuyScott

Excellent information, thanks very much!

# re: Comparing ListView with GridView,DataList and Repeater

Monday, December 28, 2009 4:35 AM by Stéphane

Thank you very much for your very helpful article

# re: Comparing ListView with GridView,DataList and Repeater

Wednesday, February 24, 2010 12:23 PM by Mercury

Just what I was looking for! THANKS!!!!

# re: Comparing ListView with GridView,DataList and Repeater

Thursday, April 22, 2010 5:37 PM by TheRage3K

Simple, and effective.  Many thanks.

# re: Comparing ListView with GridView,DataList and Repeater

Tuesday, July 27, 2010 1:39 PM by vikram

Best article I could find after a long search.

# re: Comparing ListView with GridView,DataList and Repeater

Tuesday, September 7, 2010 5:05 AM by chandradev1

Excellent article.

# re: Comparing ListView with GridView,DataList and Repeater

Tuesday, October 26, 2010 5:13 AM by dodul

Nice job.

would be better if u might hv delved deep and have elaborated.

Thank you.

Azhar rizvi

crackingsilence.blogspot.com

# re: Comparing ListView with GridView,DataList and Repeater

Monday, December 13, 2010 2:27 PM by Pierre

Simple, useful and Not Microsoft

# re: Comparing ListView with GridView,DataList and Repeater

Monday, December 20, 2010 2:21 AM by Excellent information, thanks very much

Excellent information, thanks very much

# re: Comparing ListView with GridView,DataList and Repeater

Wednesday, March 16, 2011 2:13 AM by CNU

Nice article with explanation of each one. thnk U.

# re: Comparing ListView with GridView,DataList and Repeater

Friday, April 1, 2011 5:27 AM by jayita

It is nice

# re: Comparing ListView with GridView,DataList and Repeater

Tuesday, June 21, 2011 3:56 AM by net fan

Thanks

# re: Comparing ListView with GridView,DataList and Repeater

Wednesday, August 3, 2011 6:24 AM by BIJAY KUMAR

ya,Way of the answer is very good, i like it.

every person wants to see output/Results like this.

# re: Comparing ListView with GridView,DataList and Repeater

Wednesday, October 12, 2011 1:36 AM by samina

very good explanation

# re: Comparing ListView with GridView,DataList and Repeater

Friday, November 11, 2011 3:39 AM by notandrewturvil

I've written a longish blog comparing the various data controls in ASP.NET 4.0 at www.wiseowl.co.uk/.../asp-net-data-controls.htm, if that helps.

# re: Comparing ListView with GridView,DataList and Repeater

Thursday, January 5, 2012 11:50 PM by Changhee Park

It is very helpful. Thanks

# re: Comparing ListView with GridView,DataList and Repeater

Monday, January 9, 2012 9:00 PM by sourabh

It is called the perfect answer .i was looking for...Highly appreciated