Compartir a través de


de la propiedad FilterConsumerInitEventArgs.FieldDisplayList

NOTA: esta API está ahora obsoleta.

Obtiene o establece la lista opcional de nombres para mostrar campo que se pasa al controlador de eventos para eventos deFilterConsumerInit.

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

Sintaxis

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

value = instance.FieldDisplayList

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

Valor de propiedad

Tipo: []
Una matriz de tipo string que contiene el campo opcional nombres para mostrar para el filtro proporcionado.

Ejemplos

En el ejemplo de código siguiente se muestra un método invalidado WebPart.PartCommunicationInit que crea una estructura de datos FilterConsumerInitEventArgs para contener los valores de propiedad FieldName y FieldDisplayName , se establece los valores de propiedad y, a continuación, se desencadena el evento FilterConsumerInit . Este ejemplo de código forma parte de un ejemplo más extenso de la interfaz IFilterConsumer .

Public Overrides Sub PartCommunicationInit()
    ' If the connection wasn't actually formed then don't send Init 
    ' event.
    If _connected Then
        ' Ensure that all of the Web Part's controls are created.
        ' The _filterFieldNames and _filterFieldDisplayNames are set 
        ' during EnsureChildControls().
        EnsureChildControls()

        ' Create the FilterConsumerInitEventArgs object for the 
        ' FilterConsumerInit event.
        Dim filterConsumerInitArgs As New FilterConsumerInitEventArgs()

        ' Set the field names.
        filterConsumerInitArgs.FieldList = _filterFieldNames
        filterConsumerInitArgs.FieldDisplayList = _filterFieldDisplayNames

        ' Fire the FilterConsumerInit event.
        RaiseEvent FilterConsumerInit(Me, filterConsumerInitArgs)
    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()
{
    // If the connection wasn't actually formed then don't send Init 
    // event.
    if(_connected)
    {
        // Ensure that all of the Web Part's controls are created.
        // The _filterFieldNames and _filterFieldDisplayNames are set 
        // during EnsureChildControls()
        EnsureChildControls();

        // If there is a listener, fire the FilterConsumerInit event.
        if (FilterConsumerInit != null)
        {
            // Create the FilterConsumerInitEventArgs object for the 
            // FilterConsumerInit event.
            FilterConsumerInitEventArgs filterConsumerInitArgs = new FilterConsumerInitEventArgs();
                    
            // Set the field names.
            filterConsumerInitArgs.FieldList = _filterFieldNames;
            filterConsumerInitArgs.FieldDisplayList = _filterFieldDisplayNames;
            
            // Fire the FilterConsumerInit event.
            FilterConsumerInit(this, filterConsumerInitArgs);
        }
    }
}

Vea también

Referencia

clase FilterConsumerInitEventArgs

Miembros FilterConsumerInitEventArgs

Espacio de nombres Microsoft.SharePoint.WebPartPages.Communication