Share via


FilterConsumerInitEventArgs.FieldDisplayList property

NOTE: This API is now obsolete.

Gets or sets the optional list of field display names passed to the event handler for FilterConsumerInitevent.

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

Syntax

'Declaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Public Property FieldDisplayList As String()
    Get
    Set
'Usage
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; }

Property value

Type: []
An array of type string containing the optional field display names for the provided filter.

Examples

The following code example shows an overridden WebPart.PartCommunicationInit method that creates a FilterConsumerInitEventArgs data structure to contain the FieldName and FieldDisplayName property values, sets the property values, and then fires the FilterConsumerInit event. This code example is part of a larger example provided for the IFilterConsumer interface.

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);
        }
    }
}

See also

Reference

FilterConsumerInitEventArgs class

FilterConsumerInitEventArgs members

Microsoft.SharePoint.WebPartPages.Communication namespace