wwWebRepeater::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 override the value with a custom value.

Here's a contrived example that binds the DateTime to a label in the ItemTemplate:

FUNCTION GuestList_ItemDataBind()
*** Current Template and lblName Item in the template
loTemplate = this.GuestList.ItemTemplate

*** Now get the control 
loCtl = loTemplate.FindControl("lblDate")

*** Do whatever you need to with it
loCtl.Text = TRANS(DateTime())

*** OR Databind it if you didn't data bind the list 
*oCtl.DataBind()

ENDFUNC

o.ItemDataBind()

Remarks

This event is ALWAYS fired even if you don't call DataBind() on the repeater! If you need to check whether DataBinding is active or not, you can check wwWebRepeater.lDataBindCalled (ie. GuestList.lDataBindCalled in the example above).

This method has access to a DataItem object when dealing with an Object Array Data source. The DataItem will reflect the current active object.

See also:

Class wwWebRepeater

© West Wind Technologies, 1996-2018 • Updated: 04/12/08
Comment or report problem with topic