DataItem is there only for the item-creation process, that is ItemCreated
and ItemDataBound methods (ItemCreated when it happens due to call to
DataBind). After ItemDataBound has run of for the item in question, DataItem
is explicitly set to null.
--
Teemu Keiski
ASP.NET MVP, Finland
<jw*****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
What is the explanation for the following.
if i do:
reapeter1.datasource = somedatasource
repeater1.databind()
foreach(RepeaterItem ri in repeater1.Items)
{
object o = ri.DataItem;
}
but DataItem is always null, even though it binds and displays properly