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
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
TableRow..::.CellControlCollection Class

Represents a collection of TableCell objects that are the cells of a TableRow control.

System..::.Object
  System.Web.UI..::.ControlCollection
    System.Web.UI.WebControls..::.TableRow..::.CellControlCollection

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
Visual Basic
Protected Class CellControlCollection _
    Inherits ControlCollection
C#
protected class CellControlCollection : ControlCollection
Visual C++
protected ref class CellControlCollection : public ControlCollection
F#
type CellControlCollection =  
    class
        inherit ControlCollection
    end

The TableRow..::.CellControlCollection type exposes the following members.

  NameDescription
Public propertyCountGets the number of server controls in the ControlCollection object for the specified ASP.NET server control. (Inherited from ControlCollection.)
Public propertyIsReadOnlyGets a value indicating whether the ControlCollection object is read-only. (Inherited from ControlCollection.)
Public propertyIsSynchronizedGets a value indicating whether the ControlCollection object is synchronized. (Inherited from ControlCollection.)
Public propertyItemGets a reference to the server control at the specified index location in the ControlCollection object. (Inherited from ControlCollection.)
Protected propertyOwnerGets the ASP.NET server control to which the ControlCollection object belongs. (Inherited from ControlCollection.)
Public propertySyncRootGets an object that can be used to synchronize access to the collection of controls. (Inherited from ControlCollection.)
Top
  NameDescription
Public methodAddAdds the specified Control object to the TableRow..::.CellControlCollection collection. (Overrides ControlCollection..::.Add(Control).)
Public methodAddAtAdds the specified Control object to the TableRow..::.CellControlCollection collection. The new control is added to the array at the specified index location. (Overrides ControlCollection..::.AddAt(Int32, Control).)
Public methodClearRemoves all controls from the current server control's ControlCollection object. (Inherited from ControlCollection.)
Public methodContainsDetermines whether the specified server control is in the parent server control's ControlCollection object. (Inherited from ControlCollection.)
Public methodCopyToCopies the child controls stored in the ControlCollection object to an System..::.Array object, beginning at the specified index location in the System..::.Array. (Inherited from ControlCollection.)
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 methodGetEnumeratorRetrieves an enumerator that can iterate through the ControlCollection object. (Inherited from ControlCollection.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOfRetrieves the index of a specified Control object in the collection. (Inherited from ControlCollection.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveRemoves the specified server control from the parent server control's ControlCollection object. (Inherited from ControlCollection.)
Public methodRemoveAtRemoves a child control, at the specified index location, from the ControlCollection object. (Inherited from ControlCollection.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The TableRow..::.CellControlCollection class represents the collection of TableCell objects of a TableRow control. TableCell objects can be added at the end of the TableRow..::.CellControlCollection collection with the Add method or at a specified index location in the TableRow..::.CellControlCollection with the AddAt method.

Only TableCell objects can be added to the TableRow..::.CellControlCollection collection.

The following code example demonstrates how to create a table, add elements to the table programmatically, and then display the table on the Web page. Note how the Cells property of the TableRow control represents a TableRow..::.CellControlCollection collection and how the Add method is used to add cells to the row.

This code example is part of a larger example provided for the TableRow class.

Visual Basic
' Create more rows for the table.
Dim rowNum As Integer
For rowNum = 2 To 9
    Dim tempRow As New TableRow()
    Dim cellNum As Integer
    For cellNum = 0 To 2
        Dim tempCell As New TableCell()
        tempCell.Text = _
            String.Format("({0},{1})", rowNum, cellNum)
        tempRow.Cells.Add(tempCell)
    Next
    Table1.Rows.Add(tempRow)
Next
C#
// Create more rows for the table.
for (int rowNum = 2; rowNum < 10; rowNum++)
{
    TableRow tempRow = new TableRow();
    for (int cellNum = 0; cellNum < 3; cellNum++)
    {
        TableCell tempCell = new TableCell();
        tempCell.Text = 
            String.Format("({0},{1})", rowNum, cellNum);
        tempRow.Cells.Add(tempCell);
    }
    Table1.Rows.Add(tempRow);
}

.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
TableRow..::.CellControlCollection, classe

Représente une collection d'objets TableCell qui sont les cellules d'un contrôle TableRow.

System..::.Object
  System.Web.UI..::.ControlCollection
    System.Web.UI.WebControls..::.TableRow..::.CellControlCollection

Espace de noms :  System.Web.UI.WebControls
Assembly :  System.Web (dans System.Web.dll)
Visual Basic
Protected Class CellControlCollection _
    Inherits ControlCollection
C#
protected class CellControlCollection : ControlCollection
VisualC++
protected ref class CellControlCollection : public ControlCollection
F#
type CellControlCollection =  
    class
        inherit ControlCollection
    end

Le type TableRow..::.CellControlCollection expose les membres suivants.

  NomDescription
Propriété publiqueCountObtient le nombre de contrôles serveur dans l'objet ControlCollection pour le contrôle serveur ASP.NET spécifié. (Hérité de ControlCollection.)
Propriété publiqueIsReadOnlyObtient une valeur indiquant si l'objet ControlCollection est en lecture seule. (Hérité de ControlCollection.)
Propriété publiqueIsSynchronizedObtient une valeur indiquant la synchronisation ou non de l'objet ControlCollection. (Hérité de ControlCollection.)
Propriété publiqueItemObtient une référence au contrôle serveur à l'emplacement d'index spécifié dans l'objet ControlCollection. (Hérité de ControlCollection.)
Propriété protégéeOwnerObtient le contrôle serveur ASP.NET auquel l'objet ControlCollection appartient. (Hérité de ControlCollection.)
Propriété publiqueSyncRootObtient un objet qui peut être utilisé pour synchroniser l'accès à la collection de contrôles. (Hérité de ControlCollection.)
Début
  NomDescription
Méthode publiqueAddAjoute l'objet Control spécifié à la collection TableRow..::.CellControlCollection. (Substitue ControlCollection..::.Add(Control).)
Méthode publiqueAddAtAjoute l'objet Control spécifié à la collection TableRow..::.CellControlCollection. Le nouveau contrôle est ajouté au tableau à l'emplacement d'index spécifié. (Substitue ControlCollection..::.AddAt(Int32, Control).)
Méthode publiqueClearSupprime tous les contrôles de l'objet ControlCollection du contrôle serveur en cours. (Hérité de ControlCollection.)
Méthode publiqueContainsDétermine si le contrôle serveur spécifié se trouve dans l'objet ControlCollection du contrôle serveur parent. (Hérité de ControlCollection.)
Méthode publiqueCopyToCopie les contrôles enfants stockés dans l'objet ControlCollection vers un objet System..::.Array, en commençant à l'emplacement d'index spécifié dans System..::.Array. (Hérité de ControlCollection.)
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 publiqueGetEnumeratorRécupère un énumérateur qui peut itérer au sein de l'objet ControlCollection. (Hérité de ControlCollection.)
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 publiqueIndexOfRécupère l'index d'un objet Control spécifié dans la collection. (Hérité de ControlCollection.)
Méthode protégéeMemberwiseCloneCrée une copie superficielle de l'objet Object actif. (Hérité de Object.)
Méthode publiqueRemoveSupprime le contrôle serveur spécifié de l'objet ControlCollection du contrôle serveur parent. (Hérité de ControlCollection.)
Méthode publiqueRemoveAtSupprime un contrôle enfant de l'objet ControlCollection, à l'emplacement d'index spécifié. (Hérité de ControlCollection.)
Méthode publiqueToStringRetourne une chaîne qui représente l'objet actuel. (Hérité de Object.)
Début

La classe TableRow..::.CellControlCollection représente la collection d'objets TableCell d'un contrôle TableRow. Des objets TableCell peuvent être ajoutés à la fin de la collection TableRow..::.CellControlCollection avec la méthode Add, ou à une position d'index spécifiée dans TableRow..::.CellControlCollection avec la méthode AddAt.

Seuls les objets TableCell peuvent être ajoutés à la collection TableRow..::.CellControlCollection.

L'exemple de code suivant montre comment créer une table, ajouter par programme des éléments à la table et afficher la table sur la page Web. Notez comment la propriété Cells du contrôle TableRow représente une collection TableRow..::.CellControlCollection et comment la méthode Add est utilisée pour ajouter des cellules à la ligne.

Cet exemple de code fait partie d'un exemple plus développé fourni pour la classe TableRow.

Visual Basic
' Create more rows for the table.
Dim rowNum As Integer
For rowNum = 2 To 9
    Dim tempRow As New TableRow()
    Dim cellNum As Integer
    For cellNum = 0 To 2
        Dim tempCell As New TableCell()
        tempCell.Text = _
            String.Format("({0},{1})", rowNum, cellNum)
        tempRow.Cells.Add(tempCell)
    Next
    Table1.Rows.Add(tempRow)
Next
C#
// Create more rows for the table.
for (int rowNum = 2; rowNum < 10; rowNum++)
{
    TableRow tempRow = new TableRow();
    for (int cellNum = 0; cellNum < 3; cellNum++)
    {
        TableCell tempCell = new TableCell();
        tempCell.Text = 
            String.Format("({0},{1})", rowNum, cellNum);
        tempRow.Cells.Add(tempCell);
    }
    Table1.Rows.Add(tempRow);
}

.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