Overview of Data Controls in ASP.NET 4.0
Part five of a five-part series of blogs

With the introduction of the ListView data control in ASP.NET 3.5, there are now 4 separate tools for displaying multiple rows of data in ASP.NET. Which one is best - GridView, Repeater, DataList or ListView?

  1. Data Controls in ASP.NET 4.0 - Multiple Rows
  2. Repeater Web Server Controls in ASP.NET
  3. DataList Controls - ASP.NET data controls
  4. GridView Controls in ASP.NET
  5. ListView Controls - ASP.NET data controls (this blog)

Posted by Andy Brown on 19 September 2011

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

ListView Controls in ASP.NET

The ListView web server control was introduced in ASP.NET 3.5, to get round some of the limitations of the DataList control. 

Example of a ListView Control

Here is an example of a ListView control:

An example of a ListView control

A ListView with sorting, editing and paging

I haven't shown the underlying HTML here, since it's quite long!

ListView Events

Some of the events supported by a ListView are shown below:

ListView Events

Some of the events which a ListView supports (the ones earlier on in the alphabet are missing). Many of these have equivalent GridView events.



ListViews are cool controls, if somewhat more complicated than the DataList controls they supersede.  As for GridViews, my aim is to create a blog about them in the nearish future - watch this space!

This blog has 0 threads Add post