ListProviderInitEventArgs.FieldDisplayList property

NOTE: This API is now obsolete.

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

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

Syntax

'Declaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")> _
Public Property FieldDisplayList As String()
    Get
    Set
'Usage
Dim instance As ListProviderInitEventArgs
Dim value As String()

value = instance.FieldDisplayList

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

Property value

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

Examples

The following code example shows an overridden PartCommunicationInit method that uses the FieldDisplayList property to set the optional field display names provided in an instance of the ListProviderInitEventArgs class. This code example is part of a larger example provided for the IListProvider interface.

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

See also

Reference

ListProviderInitEventArgs class

ListProviderInitEventArgs members

Microsoft.SharePoint.WebPartPages.Communication namespace