Suggérer une traduction
 
Suggestions d'autres utilisateurs :

progress indicator
Aucune autre suggestion.
Cliquez pour évaluer et commenter
MSDN
MSDN Library
Développement .NET
.NET Framework 4
Espaces de noms System.Web
System.Web.UI.WebControls
RepeaterItemCollection, classe
Réduire tout/Développer tout Réduire tout
Affichage du contenu :  côte à côteAffichage du contenu : côte à côte
.NET Framework Class Library
RepeaterItemCollection Class

Represents a collection of RepeaterItem objects in the Repeater control. This class cannot be inherited.

System..::.Object
  System.Web.UI.WebControls..::.RepeaterItemCollection

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
Visual Basic
Public NotInheritable Class RepeaterItemCollection _
    Implements ICollection, IEnumerable
C#
public sealed class RepeaterItemCollection : ICollection, 
    IEnumerable
Visual C++
public ref class RepeaterItemCollection sealed : ICollection, 
    IEnumerable
F#
[<Sealed>]
type RepeaterItemCollection =  
    class
        interface ICollection
        interface IEnumerable
    end

The RepeaterItemCollection type exposes the following members.

  NameDescription
Public methodRepeaterItemCollectionInitializes a new instance of the RepeaterItemCollection class.
Top
  NameDescription
Public propertyCountGets the number of RepeaterItem objects in the collection.
Public propertyIsReadOnlyGets a value that indicates whether the RepeaterItem objects in the RepeaterItemCollection can be modified.
Public propertyIsSynchronizedGets a value indicating whether access to the RepeaterItemCollection is synchronized (thread-safe).
Public propertyItemGets the RepeaterItem object at the specified index in the collection.
Public propertySyncRootGets the object that can be used to synchronize access to the RepeaterItemCollection collection.
Top
  NameDescription
Public methodCopyToCopies all the items from this RepeaterItemCollection to the specified System..::.Array object, starting at the specified index in the System..::.Array object.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns a System.Collections..::.IEnumerator interface that can iterate through all the RepeaterItem objects in the RepeaterItemCollection.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public Extension MethodAsParallelEnables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodCast<(Of <(TResult>)>)Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodOfType<(Of <(TResult>)>)Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top

The RepeaterItemCollection class represents a collection of RepeaterItem objects, which in turn represent the data items in a Repeater control. To programmatically retrieve RepeaterItem objects from a Repeater control, use one of the following methods:

  • Use the indexer to get a single RepeaterItem object from the collection using array notation.

  • Use the CopyTo method to copy the contents of the collection to a System..::.Array object, which can then be used to get items from the collection.

  • Use the GetEnumerator method to create an System.Collections..::.IEnumerator interface, which can then be used to get items from the collection.

  • Use foreach (C#) or For Each (Visual Basic) to iterate through the collection.

The Count property specifies the total number of items in the collection and is commonly used to determine the upper bound of the collection.

Visual Basic
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
C#
      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();
}
      }

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Bibliothèque de classes .NET Framework
RepeaterItemCollection, classe

Représente une collection d'objets RepeaterItem dans le contrôle Repeater. Cette classe ne peut pas être héritée.

System..::.Object
  System.Web.UI.WebControls..::.RepeaterItemCollection

Espace de noms :  System.Web.UI.WebControls
Assembly :  System.Web (dans System.Web.dll)
Visual Basic
Public NotInheritable Class RepeaterItemCollection _
    Implements ICollection, IEnumerable
C#
public sealed class RepeaterItemCollection : ICollection, 
    IEnumerable
VisualC++
public ref class RepeaterItemCollection sealed : ICollection, 
    IEnumerable
F#
[<Sealed>]
type RepeaterItemCollection =  
    class
        interface ICollection
        interface IEnumerable
    end

Le type RepeaterItemCollection expose les membres suivants.

  NomDescription
Méthode publiqueRepeaterItemCollectionInitialise une nouvelle instance de la classe RepeaterItemCollection.
Début
  NomDescription
Propriété publiqueCountObtient le nombre d'objets RepeaterItem dans la collection.
Propriété publiqueIsReadOnlyObtient une valeur qui indique si les objets RepeaterItem de RepeaterItemCollection peuvent être modifiés.
Propriété publiqueIsSynchronizedObtient une valeur indiquant si l'accès à RepeaterItemCollection est synchronisé (thread-safe).
Propriété publiqueItemObtient l'objet RepeaterItem à l'index spécifié dans la collection.
Propriété publiqueSyncRootObtient l'objet qui peut être utilisé pour synchroniser l'accès à la collection RepeaterItemCollection.
Début
  NomDescription
Méthode publiqueCopyToCopie tous les éléments de RepeaterItemCollection dans l'objet System..::.Array spécifié, en commençant à l'index spécifié dans l'objet System..::.Array.
Méthode publiqueEquals(Object)Détermine si l'Object spécifié est égal à l'Object en cours. (Hérité de Object.)
Méthode protégéeFinalizeAutorise un objet à tenter de libérer des ressources et d'exécuter d'autres opérations de netto***ge avant qu'il ne soit récupéré par l'opération garbage collection. (Hérité de Object.)
Méthode publiqueGetEnumeratorRetourne une interface System.Collections..::.IEnumerator qui peut itérer au sein de tous les objets RepeaterItem de RepeaterItemCollection.
Méthode publiqueGetHashCodeSert de fonction de hachage pour un type particulier. (Hérité de Object.)
Méthode publiqueGetTypeObtient le Type de l'instance actuelle. (Hérité de Object.)
Méthode protégéeMemberwiseCloneCrée une copie superficielle de l'objet Object actif. (Hérité de Object.)
Méthode publiqueToStringRetourne une chaîne qui représente l'objet actuel. (Hérité de Object.)
Début
  NomDescription
Méthode d'extension publiqueAsParallelActive la parallélisation d'une requête. (Défini par ParallelEnumerable.)
Méthode d'extension publiqueAsQueryableConvertit un IEnumerable en IQueryable. (Défini par Queryable.)
Méthode d'extension publiqueCast<(Of <(TResult>)>)Convertit les éléments d'un IEnumerable vers le type spécifié. (Défini par Enumerable.)
Méthode d'extension publiqueOfType<(Of <(TResult>)>)Filtre les éléments d'un IEnumerable en fonction du type spécifié. (Défini par Enumerable.)
Début

La classe RepeaterItemCollection représente une collection d'objets RepeaterItem, qui à son tour représente les éléments de données dans un contrôle Repeater. Pour récupérer par programme des objets RepeaterItem d'un contrôle Repeater, utilisez l'une des méthodes suivantes :

  • Utilisez l'indexeur pour obtenir un seul objet RepeaterItem de la collection à l'aide d'une notation de tableau.

  • Utilisez la méthode CopyTo pour copier le contenu de la collection vers un objet System..::.Array, qui peut ensuite être utilisé pour obtenir des éléments de la collection.

  • Utilisez la méthode GetEnumerator pour créer une interface System.Collections..::.IEnumerator qui peut ensuite être utilisée pour obtenir des éléments de la collection.

  • Utilisez foreach (C#) ou For Each (Visual Basic) pour itérer au sein de la collection.

La propriété Count spécifie le nombre total d'éléments dans la collection et est généralement utilisée pour déterminer la limite supérieure de la collection.

Visual Basic
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
C#
      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();
}
      }

.NET Framework

Pris en charge dans : 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows XP SP2 Édition x64, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2

Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Tous les membres static (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.
Contenu de la communauté   Qu'est-ce que le Contenu de la communauté ?
Ajouter du contenu RSS  Annotations
Processing
© 2012 Microsoft. Tous droits réservés. Conditions d'utilisation | Marques | Confidentialité
Page view tracker