Partager via


ICellConsumer.CellReady - Méthode

Remarque : cette API est désormais obsolète.

Appelée après l'événement CellReady pour un composant WebPart connecté, par exemple lorsqu'une cellule est sélectionnée ou mis à jour. Ce gestionnaire d'événements est de type CellReadyEventHandler.

Espace de noms :  Microsoft.SharePoint.WebPartPages.Communication
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartField instead")> _
Sub CellReady ( _
    sender As Object, _
    cellReadyArgs As CellReadyEventArgs _
)
'Utilisation
Dim instance As ICellConsumer
Dim sender As Object
Dim cellReadyArgs As CellReadyEventArgs

instance.CellReady(sender, cellReadyArgs)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartField instead")]
void CellReady(
    Object sender,
    CellReadyEventArgs cellReadyArgs
)

Paramètres

  • sender
    Type : System.Object

    Le composant WebPart qui est la source de l'événement.

Exemples

L'exemple de code suivant illustre l'implémentation d'un gestionnaire d'événements CellReady . Cet exemple de code fait partie d'un exemple plus développé fourni pour l'interface ICellConsumer .

' Step #9: Implement the CellReady event handler.
' The connected provider part(s) will call this method during its 
' PartCommunicationMain phase
' to pass their primary data to the consumer Web Part.
' <param name="sender">Reference to the provider Web Part</param>
' <param name="cellReadyEventArgs">The args passed by the provider Web 
' Part</param>
Public Sub CellReady(sender As Object, cellReadyEventArgs As 
   CellReadyEventArgs) Implements ICellConsumer.CellReady
    ' Make sure child controls have been created.
     EnsureChildControls()
   
    ' Set the label text to the value of the cell that was passed by 
    ' the provider part.
     If Not (cellReadyEventArgs.Cell Is Nothing) Then
       _cellConsumerTextBox.Text = cellReadyEventArgs.Cell.ToString()
     End If
End Sub
// Step #9: Implement the CellReady event handler.
// The connected provider part(s) will call this method during its 
// PartCommunicationMain phase
// to pass their primary data to the consumer Web Part.
// <param name="sender">Reference to the provider Web Part</param>
// <param name="cellReadyEventArgs">The args passed by the provider Web 
// Part</param>
public void CellReady(object sender, CellReadyEventArgs cellReadyEventArgs)
{
    // Make sure child controls have been created.
    EnsureChildControls();

    // Set the label text to the value of the cell that was passed by 
    // the provider part.
    if(cellReadyEventArgs.Cell != null)
    {
        _cellConsumerTextBox.Text = cellReadyEventArgs.Cell.ToString();
    }
}

Voir aussi

Référence

ICellConsumer interface

ICellConsumer - Membres

Microsoft.SharePoint.WebPartPages.Communication - Espace de noms