RepeaterItemCollection Constructor (ArrayList)


Initializes a new instance of the RepeaterItemCollection class.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public RepeaterItemCollection(
	ArrayList items


Type: System.Collections.ArrayList

A System.Collections.ArrayList that contains the items with which to initialize the collection.

Use this constructor to create and initialize a new instance of the RepeaterItemCollection class.

      void Page_Load(Object Sender, EventArgs e)
if (!IsPostBack)
   ArrayList myDataSource = new ArrayList();

   myDataSource.Add(new PositionData("Item 1", "$6.00"));
   myDataSource.Add(new PositionData("Item 2", "$7.48"));
   myDataSource.Add(new PositionData("Item 3", "$9.96"));

   // Initialize the RepeaterItemCollection using the ArrayList as the data source.
   RepeaterItemCollection myCollection = new RepeaterItemCollection(myDataSource);
   myRepeater.DataSource = myCollection;

.NET Framework
Available since 1.1
Return to top