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 :
- A very flexible and customizable layout.
- A built in data paging support with the new DataPager control.
- Support data grouping (repeating items) in a flexible way.
- 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.
Categories
- AngularJs (13)
- ASP.NET (104)
- C Programming (1)
- Code Project (2)
- CodeProject (1)
- Entity Framework (6)
- Ext.NEt (1)
- HTML5 (1)
- Interview .NET (2)
- Introduction (1)
- JQuery (1)
- Linq (1)
- Microsoft office (2)
- MOSS-(Sharepoint 2010) (2)
- MVC (5)
- Outlook (1)
- Sql Server (30)
- SSRS (5)
- TFS (1)
- Tips & Tricks (16)
- Twitter bootstrap (1)
- VB.NET (1)
- Visual Studio 2012/2013 (1)
- Web Services (1)
- Windows Workflow (1)
Top Posts & Pages
- MYSQL : How to skip first 10 records from a SELECT query and take next 10?
- Kendo grid error : kendo.all.min.js:12 Uncaught TypeError: e.slice is not a function
- How to compile .NET Core Console Application as .exe File?
- Entity Framework : Could not load type System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider
- USAePay Token error: 23 Specified source key not found
- Modify Collection while Iterating C#
- How to validate a valid GUID Value in C#
- Disable click outside of bootstrap model area to close modal
- How to Add space and increase width of Morris.Js Bar?
- ASP.NET Routing with IIS 7 (runallmanagedmodulesforallrequests = true)
Recent Posts
- How to compile .NET Core Console Application as .exe File?
- Define Composite Key in Model.(Core, EF Code First)
- How to remove x from Internet Explorer ?
- The client and server cannot communicate, because they do not possess a common algorithm
- How to check if all items are the same in a list C#
- How to Collapse all #regions only(!) in C# (Visual Studio)
- Issue: Password field returned empty in edit mode
- Load XML from URL giving an error (The remote server returned an error: (401) Unauthorized.)
- How to use Variable in MySQL Like Clause ?
- Error :(System.Web.UI.HtmlControls.HtmlIframe) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl) in VS2017
Blog Stats
- 156,045 hits
Rahul Bhatia
Profile
Blog Stats
- 156,045 hits
Comments