Compartir a través de


RepeaterItemCollection(ArrayList) Constructor

Definición

Inicializa una nueva instancia de la clase RepeaterItemCollection.

public:
 RepeaterItemCollection(System::Collections::ArrayList ^ items);
public RepeaterItemCollection (System.Collections.ArrayList items);
new System.Web.UI.WebControls.RepeaterItemCollection : System.Collections.ArrayList -> System.Web.UI.WebControls.RepeaterItemCollection
Public Sub New (items As ArrayList)

Parámetros

items
ArrayList

ArrayList que contiene los elementos con que inicializar la colección.

Ejemplos

      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;
   myRepeater.DataBind();
}
      }
Sub Page_Load(Sender As Object, e As EventArgs)
   If Not IsPostBack Then
      Dim myDataSource As 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.
      Dim myCollection As New RepeaterItemCollection(myDataSource)
      myRepeater.DataSource = myCollection
      myRepeater.DataBind()
   End If
End Sub 'Page_Load

Comentarios

Use este constructor para crear e inicializar una nueva instancia de la RepeaterItemCollection clase .

Se aplica a

Consulte también