ASP.NET Repeater DataBind Custom Object

Suppose we wish to databind a List:

        //Or any kind of list...
        List ints = new List() { 1, 2, 3, 10, 19 };
        Repeater1.DataSource = ints;
        Repeater1.DataBind();
        <asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                        <%# Container.DataItem %>
                </ItemTemplate>
        </asp:Repeater>

Or suppose we have a custom object:

        public class myFooBarCollection{
                public class FooBar{
                        public int myFooBarNumber = 0;
                        public String myFoorBarText = "";
                }

                public int somefield;
                public List foobarcollection = new List();
        }
        //...
        protected void Page_Load(object sender, EventArgs e){
                Repeater1.DataSource = (new myFooBarCollection()).foobarcollection;
                Repeater1.DataBind();
        }
        <asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                        Index: <%# Container.ItemIndex %>
                        Item: <%# ((myFooBarCollection.FooBar)Container.DataItem).myFooBarText %>
                </ItemTemplate>
        </asp:Repeater>

Databinding to Custom Objects
Not much has changed. Note that in this example, myCustomObjectCollection is a collection of a class that has fields theTextFieldName and theValueFieldName that have get and set methods (ie, public int theValueFieldName {get; set;}).

myASPRadioButtonList.DataSource = myCustomObjectCollection;
myASPRadioButtonList.DataTextField = "theTextFieldName";
myASPRadioButtonList.DataValueField = "theValueFieldName";
myASPRadioButtonList.DataBind();