ASP.NET ListView

The ListView control displays data in a format that you define by using templates and styles.

To display items in groups, you use a server control in the LayoutTemplate template to act as the placeholder for the group. For example, you might use a TableRow control. You set the placeholder control's ID property to groupPlaceholder. At run time, this placeholder control will be replaced with the contents of the GroupTemplate template.

You then add a placeholder control and set its ID property to itemPlaceholder. This control is only a placeholder for the other templates, usually the ItemTemplate template. As a result, at run time, this control will be replaced with the content from the other templates. The content is repeated the number of items specified by the GroupItemCount property of the ListView control.

<asp:ListView runat="server" ID="ProductsListView"
    DataSourceID="ProductsSqlDataSource" DataKeyNames="ProductID">
    <table cellpadding="2" runat="server"
           id="tblProducts" style="height:320px">
      <tr runat="server" id="groupPlaceholder">
    <asp:DataPager runat="server" ID="DataPager"
         <asp:NumericPagerField ButtonCount="3"
              NextPageText="-->" />
    <tr runat="server" id="productRow"
      <td runat="server" id="itemPlaceholder">
    <td valign="top" align="center" style="width:100" runat="server">
      <asp:Image ID="ProductImage" runat="server"
           ImageUrl='<%#"~/images/thumbnails/" + 
               Eval("ThumbnailPhotoFileName") %>'
           Height="49" /><br />
      <asp:HyperLink ID="ProductLink" runat="server"
           Target="_blank" Text='<% #Eval("Name")%>'
           NavigateUrl='<%#"ShowProduct.aspx?ProductID=" + 
              Eval("ProductID") %>' />

MSDN: ListView Web Server Control Overview

MSDN: ListView Tips and Tricks

Nested ListViews