Anas Ghanem

ASP.NET from the middle east

Syndication

Sponsors

News


    Subscribe in a reader
Comparing ListView with GridView,DataList and Repeater

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

I believe the 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 DataPager control.
  3. support data grouping ( repeating items) .
  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

 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 06, 2008 4:02 PM by anas
Filed under:

Comments

# funny wallpaper » Comparing ListView with GridView,DataList and Repeater@ Saturday, September 06, 2008 10:13 AM

Pingback from  funny wallpaper » Comparing ListView with GridView,DataList and Repeater

# re: Comparing ListView with GridView,DataList and Repeater @ Monday, September 08, 2008 12:39 AM

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

by kamii47

# re: Comparing ListView with GridView,DataList and Repeater @ Monday, September 08, 2008 2:12 PM

kamii47

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

Thanks , I added the sorting to the  table .

by anas

# Creating a databound grid view control from a sample wireframe table@ Wednesday, October 15, 2008 6:33 PM

Creating a databound grid view control from a sample wireframe table

# re: Comparing ListView with GridView,DataList and Repeater @ Monday, October 20, 2008 5:39 AM

Nice article

by Amara

# re: Comparing ListView with GridView,DataList and Repeater @ Thursday, October 23, 2008 4:21 PM

Is the data grouping like a nested control?

by fr3dr1k

# re: Comparing ListView with GridView,DataList and Repeater @ Saturday, November 15, 2008 12:11 PM

Nice, just what I was looking for.

# re: Comparing ListView with GridView,DataList and Repeater @ Wednesday, March 18, 2009 9:04 AM

nice work.

by maifs

# re: Comparing ListView with GridView,DataList and Repeater @ Wednesday, March 18, 2009 9:30 AM

very nice

by maifs

Leave a Comment

(required) 
(required) 
(optional)
(required)