Compartir a través de


de la propiedad ListProviderInitEventArgs.FieldList

NOTA: esta API está ahora obsoleta.

Obtiene o establece la lista de nombres de campo que se pasa al controlador de eventos para el evento deListProviderInit.

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

Sintaxis

'Declaración
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")> _
Public Property FieldList As String()
    Get
    Set
'Uso
Dim instance As ListProviderInitEventArgs
Dim value As String()

value = instance.FieldList

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

Valor de propiedad

Tipo: []
Una matriz de tipo string que contiene los nombres de campo en la lista de datos proporcionado. Estos nombres de campo se muestran en la interfaz de usuario si no se da el FieldDisplayList .

Ejemplos

En el ejemplo de código siguiente se muestra un método invalidado PartCommunicationInit que usa la propiedad FieldList para establecer los nombres de campo proporcionados en una instancia de la clase ListProviderInitEventArgs . Este ejemplo de código forma parte de un ejemplo más extenso de la interfaz IListProvider .

      ' Step #7: Override PartCommunicationInit method.
      ' PartCommunicationInit() 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 ListProviderInitEventArgs object for the ListProviderInit event.
                Dim listProviderInitArgs As New ListProviderInitEventArgs()

                ' Set the list field names.
                listProviderInitArgs.FieldList = _listFieldNames
                listProviderInitArgs.FieldDisplayList = _listFieldDisplayNames

                ' Fire the ListProviderInit event.
                RaiseEvent ListProviderInit(Me, listProviderInitArgs)
            End If
        End Sub       
// Step #7: Override PartCommunicationInit method.
// PartCommunicationInit() 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 ListProviderInit event.
        if (ListProviderInit != null)
        {
            // Create the ListProviderInitEventArgs object for the ListProviderInit event.
            ListProviderInitEventArgs listProviderInitArgs = new ListProviderInitEventArgs();
            
            // Set the list field names.
            listProviderInitArgs.FieldList = _listFieldNames;
            listProviderInitArgs.FieldDisplayList = _listFieldDisplayNames;

            // Fire the ListProviderInit event.
            ListProviderInit(this, listProviderInitArgs);
        }
    }
}

Vea también

Referencia

clase ListProviderInitEventArgs

Miembros ListProviderInitEventArgs

Espacio de nombres Microsoft.SharePoint.WebPartPages.Communication