Home     About PeterBlum.com     Policies     Download a Licensed Product     Newsletter

Peter's Business Logic Driven UI
The BLDListView control: Replacement for both GridView and ListView
Back to Product Overview

The BLDListView control is the recommended DataBound control for list-style interfaces within BLD. While you can also use the GridView and ListView controls for these interfaces, both have limitations that are overcome by the BLDListView control.

Quality GridView ListView BLDListView
Easy to setup Very easy Difficult Very easy
Ability to customize HTML Minimal Complete Complete
Supports automatic scaffolding Yes No Yes

BLDListView is really a blend of the ListView control with Pattern Templates. It subclasses from System.Web.IU.WebControls.ListView. As a result, it has every feature of ListView. Internally, it populates all of the Templates found on ListView with PatternTemplates. You provide a list of data fields to the BLDListView (optionally using scaffolding) and it builds the HTML output by connecting each data field name to the controls defined in the PatternTemplate.

If needed, you can switch to declaring controls directly in its Templates, making it return to its ListView roots.

The default BLDListView control uses the GridView.ascx PatternTemplate file which mimics the appearance of the GridView control. A second PatternTemplate file, ListOfDetailViews.ascx, shows each record in the style of the DetailsView control. Create your own PatternTemplates to address your specific formatting.


<des:BLDListView ID="BLDListView1" runat="server" DataSourceID="ListDataSource" >
</des:BLDListView>
The most simple setup. It uses the GridView.ascx PatternTemplate and automatic scaffolding.

<des:BLDListView ID="BLDListView1" runat="server" DataSourceID="ListDataSource" PatternTemplateName="ListOfDetailViews">
  <ItemsInPattern>
    <des:DataFieldInPattern DataField="ProductName" />
    <des:DataFieldInPattern DataField="UnitPrice" />
    <des:DataFieldInPattern DataField="QuantityPerUnit" />
    <des:DataFieldInPattern DataField="ReorderLevel" />
    <des:DataFieldInPattern DataField="UnitsInStock" />
    <des:DataFieldInPattern DataField="Discontinued" />
  </ItemsInPattern>
  <NamedStyles>
    <des:NamedStyle DataField="QuantityPerUnit" Style="white-space:nowrap;" />
  </NamedStyles>
</des:BLDListView>
Using an alternative PatternTemplate and explicitly defining the list of data fields.


Back to Product Overview