Home     About PeterBlum.com     Policies     Download a Licensed Product     Newsletter

Peter's Business Logic Driven UI
The BLDFormView control: Replacement for both DetailsView and FormView
Back to Product Overview

The BLDFormView control is the recommended DataBound control for single record-style interfaces within BLD. While you can also use the DetailsView and FormView controls for these interfaces, both have limitations that are overcome by the BLDFormView control.

Quality DetailsView FormView BLDFormView
Easy to setup Very easy Difficult Very easy
Ability to customize HTML Minimal Complete Complete
Supports automatic scaffolding Yes No Yes

BLDFormView is really a blend of the FormView control with Pattern Templates. It subclasses from System.Web.IU.WebControls.FormView. As a result, it has every feature of FormView. Internally, it populates all of the Templates found on FormView with PatternTemplates. You provide a list of data fields to the BLDFormView (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 FormView roots.

The default BLDFormView control uses the DetailsView.ascx PatternTemplate file which mimics the appearance of the DetailsView control. Create your own PatternTemplates to address your specific formatting.


<des:BLDFormView ID="BLDFormView1" runat="server" DataSourceID="DetailDataSource" >
</des:BLDFormView>
The most simple setup. It uses the DetailsView.ascx PatternTemplate and automatic scaffolding.

<des:BLDFormView ID="BLDFormView1" runat="server" DataSourceID="DetailsDataSource" PatternTemplateName="MyCustomTemplate">
  <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 Name="LabelColumn" CssClass="FancyColumnNames" />
  </NamedStyles>
</des:BLDFormView>
Using an alternative PatternTemplate and explicitly defining the list of data fields.


Back to Product Overview