Home All Groups Group Topic Archive Search About
Author
18 Mar 2005 5:56 AM
Mike Chamberlain
Can someone explain what the Container object is, and how it it related
to data binding?  I can't find any reference for it anywhere.

Mike

Author
18 Mar 2005 12:52 PM
Brock Allen
When you write DataBinding syntax a method is created that gets called for
every row that will be created for your databinding control. Container is
a local variable in that method which is a reference to the row in the control
that was just created. DataItem is typically the property on the row object
that references the row from the original data source that the row is built
from.

A great way to understand what's going on is to do this:

<ItemTemplate><%# Container.DataItem.GetType().FullName %></ItemTemplate>

This will emit the type of object Container is. For different data bound
controls you'll see different output. Once you know the Container type, then
go look up in the docs about it.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> Can someone explain what the Container object is, and how it it
> related to data binding?  I can't find any reference for it anywhere.
>
> Mike
>