ASP.NET Web Forms

Using a ListView Control

The ListView control is used to display multiple items of data using group, layout and item templates. This is the most flexible of the controls and can be used in the same way as the GridView to create, remove, update and display data (CRUD). Unlike the GridView it is entirely template driven and it can be used to add new data.

ListView data Control

ListView data Control

In the example above a ListView is displaying data based on the Wine class using a Select method called GetAllWines and it will display a group of three items across the page.

ListView Item Template

In the example above one item will be displayed as a Bootstrap Card. However by using the Layout and Group templates three cards can be arranged into one row in a grid.

ListView Templates

The end result is shown below.

Web Forms Index