RowProviderInitEventArgs - Classe

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

Fournit les noms de champ et les noms complets de champ facultatif pour la ligne fournie par un composant qui implémente l'interface de**[:Microsoft.SharePoint.WebPartPages.Communication.IRowProvider]** de **[T]**lorsque l'événement RowProviderInit se produit.

Hiérarchie d’héritage

System.Object
  System.EventArgs
    Microsoft.SharePoint.WebPartPages.Communication.InitEventArgs
      Microsoft.SharePoint.WebPartPages.Communication.RowProviderInitEventArgs

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

Syntaxe

'Déclaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartRow instead")> _
Public NotInheritable Class RowProviderInitEventArgs _
    Inherits InitEventArgs
'Utilisation
Dim instance As RowProviderInitEventArgs
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartRow instead")]
public sealed class RowProviderInitEventArgs : InitEventArgs

Exemples

L'exemple de code suivant montre une méthode substituée WebPart.PartCommunicationInit qui crée un objet RowProviderInitEventArgs , définit les noms de champs et affiche les noms puis déclenche l'événement RowProviderInit . Cet exemple de code fait partie d'un exemple plus développé fourni pour l'interface Microsoft.SharePoint.WebPartPages.Communication.IRowProvider .

      ' Step #7: Override the PartCommunicationInit() method.
      ' The PartCommunicationInit method is called by the Web Part infrastructure during the ASP.NET PreRender 
      ' event to allow the part to pass initialization information to the other connected parts.
      ' It is important to always pass initialization information. Some parts
      ' may not behave properly if this initialization information is not received.
      Public Overrides Sub PartCommunicationInit()
            ' Ensure that all of the Web Part's controls are created.
            EnsureChildControls()

            ' Check if connected.
            If _connected Then
                ' Create the RowProviderInitEventArgs object for the RowProviderInit event.
                Dim rowProviderInitEventArgs As New RowProviderInitEventArgs()

                ' Set the row field names.
                rowProviderInitEventArgs.FieldList = _rowFieldNames

                ' Set the row field display names.
                rowProviderInitEventArgs.FieldDisplayList = _rowFieldDisplayNames

                ' Fire the RowProviderInit event.
                RaiseEvent RowProviderInit(Me, rowProviderInitEventArgs)
            End If
        End Sub
        // Step #7: Override the PartCommunicationInit() method.
        // The PartCommunicationInit method is called by the Web Part infrastructure during the ASP.NET PreRender 
        // event to allow the part to pass initialization information to the other connected parts.
        // It is important to always pass initialization information. Some parts
        // may not behave properly if this initialization information is not received.
        public override void PartCommunicationInit()
        {
            // Ensure that all of the Web Part's controls are created.
            EnsureChildControls();

            // Check if connected.
            if(_connected)
            {
                // If there is a listener, fire the RowProviderInit event.
                if (RowProviderInit != null)
                {
                    // Create the RowProviderInitEventArgs object for the RowProviderInit event.
                    RowProviderInitEventArgs rowProviderInitEventArgs = new RowProviderInitEventArgs();
                    
                    // Set the row field names.
                    rowProviderInitEventArgs.FieldList = _rowFieldNames;

                    // Set the row field display names.
                    rowProviderInitEventArgs.FieldDisplayList = _rowFieldDisplayNames;

                    // Fire the RowProviderInit event.
                    RowProviderInit(this, rowProviderInitEventArgs);
                }
            }
        }

Cohérence de thread

Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.

Voir aussi

Référence

RowProviderInitEventArgs - Membres

Microsoft.SharePoint.WebPartPages.Communication - Espace de noms