Class wwWebRepeater

The WebRepeater class provides a template driven repeatable display bound to a datasource. The repeater supports Cursors, Object Arrays and Object Collections for databinding.

Repeaters work by using templates for displaying content. It has an ItemTemplate, Alternating Item template footer and header templates which can in turn contain other controls, expressions and literal text.

html
html
<ww:wwWebRepeater runat="server" id="repItems" ItemChanged="repItems_ItemChanged" DataSource="tt_cust"> <HeaderTemplate> <h1>Customer List</h1> </HeaderTemplate> <ItemTemplate> Company: <ww:wwWebLabel runat="server" Text="hello" ControlSource="tt_cust.company"></ww:wwWebLabel> Name: <%= tt_cust.Careof %> <hr> </ItemTemplate> <FooterTemplate> <small>generated at: <%= DateTime() %></small> </FooterTemplate> </ww:wwWebRepeater>

Note:
In order for the ControlSource binding to work you have to call DataBind() on the repeater either explicitly or through the Page's DataBind() method. <%= Expression %> binding always works regardless of whether DataBind() was called or not.

Custom wwWebControl wwWebRepeater

Remarks

Any child controls that are rendered inside of a repeater only call OnInit() for performance reasons. This means that some controls may not work as expected. The reason is performance and also the fact that repeater renders data items as part of the .Render() process of the page and doesn't run through the full page cycle of events.

Class Members

MemberDescription
DataSource The DataSource that is bound to this control. Can be a Cursor, Array of objects or a collection of Objects. The ItemTemplate sees each DataItem as a *DataItem* object variable when Array or Cursor…
DataSourceType 1 - Cursor/Table 2 - One Dimensional Object Array 3 - Collection of Objects The ItemTemplate sees each DataItem as a DataItem object when Array or Cursor data is used.
IsAlternatingItem Flag that determines if during rendering an alternating item is active. Allows you to create quick switches in the ItemTemplate without having to have a separate…
DataBindItemTemplate Determines whether child controls are databound in item templates. Set to false to improve performance when you don't have Web Controls that require DataBind() to fire inside of a template and want…
MaxItems Maximum number of items to display in this list. 0 means display all.
NoDataHtml Text string/html to display if there's no data to display, ie. the datasource contains no data.
ItemChanged Event that fires just after a new item has been loaded. You can hook this event to affect processing that occurs just before the data item is rendered. You can also use this event to set the…
ItemDataBind Event that is fired when an each item is databound in the ItemTemplate. This method actually fires after general databinding (if any) for the template has been performed and gives the opportunity to…
ItemPreRender Called just before a data item is rendered. This event occurs after control state - if any - has been restored
ActiveItemTemplate The currently active Item template instance while iterating over items. You can use this object in ItemDataBind() to grab the current template object if necessary.

© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic