Compartilhar via


RowProviderInitEventArgs.FieldList property

NOTE: This API is now obsolete.

Obtém ou define os nomes dos campos passados para o manipulador de eventos para o evento RowProviderInit .

Namespace:  Microsoft.SharePoint.WebPartPages.Communication
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaração
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartRow instead")> _
Public Property FieldList As String()
    Get
    Set
'Uso
Dim instance As RowProviderInitEventArgs
Dim value As String()

value = instance.FieldList

instance.FieldList = value
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartRow instead")]
public string[] FieldList { get; set; }

Property value

Type: []
Uma matriz de tipo string que contém os nomes de campo na linha de dados fornecido. Esses nomes de campo são exibidos na interface do usuário se o FieldDisplayList não for fornecido.

Examples

O exemplo de código a seguir mostra um método substituído WebPart.PartCommunicationInit que cria um objeto RowProviderInitEventArgs , define os nomes de campo e exibe nomes e dispara o evento RowProviderInit . Este exemplo de código é parte de um exemplo maior fornecido para a interface 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);
                }
            }
        }

Ver também

Referência

RowProviderInitEventArgs class

RowProviderInitEventArgs members

Microsoft.SharePoint.WebPartPages.Communication namespace