Click here to Skip to main content
12,897,124 members (46,337 online)
Click here to Skip to main content
Add your own
alternative version

Stats

35.2K views
5 bookmarked
Posted 11 Oct 2013

Comparing ListView with GridView,DataList and Repeater

, 11 Oct 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
  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

Editorial Note

This articles was originally at wiki.asp.net but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

  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 .

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
ControlPagingData GroupingProvide Flexible LayoutUpdate,DeleteInsertSorting
ListView supportedsupportedsupportedsupportedsupportedsupported
GridViewsupportedNot supportedNot SupportedsupportedNot Supportedsupported
DataListNot supportedsupportedsupportedsupportedNot supportedNot supported
RepeaterNot supportedNot supportedsupportedNot supportedNot supportedNot 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.

 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

ASP.NET Community
United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
Group type: Collaborative Group

767 members


You may also be interested in...

Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170424.1 | Last Updated 11 Oct 2013
Article Copyright 2013 by ASP.NET Community
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid