Evento IRowProvider.RowProviderInit

NOTA: esta API está ahora obsoleta.

Envía los nombres y los nombres para mostrar de los campos en la fila proporcionada.

Espacio de nombres:  Microsoft.SharePoint.WebPartPages.Communication
Ensamblado:  Microsoft.SharePoint (en Microsoft.SharePoint.dll)

Sintaxis

'Declaración
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartRow instead")> _
Event RowProviderInit As RowProviderInitEventHandler
'Uso
Dim instance As IRowProvider
Dim handler As RowProviderInitEventHandler

AddHandler instance.RowProviderInit, handler
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartRow instead")]
event RowProviderInitEventHandler RowProviderInit

Comentarios

El controlador de eventos recibe un argumento de tipo Microsoft.SharePoint.WebPartPages.Communication.RowProviderInitEventArgs que contiene los datos relacionados con este evento. Las propiedades de RowProviderInitEventArgs FieldList y FieldDisplayList proporcionan información específica de este evento.

Ejemplos

En el ejemplo de código siguiente se muestra un método invalidado WebPart.PartCommunicationInit que crea un objeto deRowProviderInitEventArgs, establece los nombres de campo y mostrar los nombres y, a continuación, se desencadena el evento RowProviderInit . Este ejemplo de código forma parte de un ejemplo más extenso de la interfaz 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);
                }
            }
        }

Vea también

Referencia

interfaz IRowProvider

Miembros IRowProvider

Espacio de nombres Microsoft.SharePoint.WebPartPages.Communication