Share via


IFilterProvider.FilterConsumerInit method

NOTE: This API is now obsolete.

An event handler for the FilterConsumerInit event that receives the list of fields, and optionally field display names.

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

Syntax

'Declaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Sub FilterConsumerInit ( _
    sender As Object, _
    filterConsumerInitEventArgs As FilterConsumerInitEventArgs _
)
'Usage
Dim instance As IFilterProvider
Dim sender As Object
Dim filterConsumerInitEventArgs As FilterConsumerInitEventArgs

instance.FilterConsumerInit(sender, filterConsumerInitEventArgs)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")]
void FilterConsumerInit(
    Object sender,
    FilterConsumerInitEventArgs filterConsumerInitEventArgs
)

Parameters

  • sender
    Type: System.Object

    Reference to the object calling this method, which is typically this.

Examples

The following code example shows an implementation of the FilterConsumerInit. This code example is part of a larger example provided for the IFilterProvider interface.

      ' Step #8: Implement the FilterConsumerInit() method.
      ' The connected consumer part will call this method during its 
      ' PartCommunicationInit phase
      ' to pass initialization information to the provider Web Part.
      ' The column names from the
      ' consumer Web Part are passed in. In this example, these values 
      ' are used to dynamcially 
      ' generate the input text boxes in the provider Web Part.
      ' <param name="sender">Consumer Web Part</param>
      ' <param name="filterConsumerInitArgs">The args passed by the 
      ' Consumer</param>
      Public Sub FilterConsumerInit(sender As Object, 
         filterConsumerInitEventArgs As FilterConsumerInitEventArgs) 
            Implements IFilterProvider.FilterConsumerInit
         If Not (filterConsumerInitEventArgs.FieldList Is Nothing) Then
            _fieldList = filterConsumerInitEventArgs.FieldList
         Else
            _fieldList = Nothing
         End If 
         If Not (filterConsumerInitEventArgs.FieldDisplayList Is 
            Nothing) Then
            _fieldDisplayList = 
               filterConsumerInitEventArgs.FieldDisplayList
         Else
            _fieldDisplayList = Nothing
         End If 
      End Sub
// Step #8: Implement the FilterConsumerInit() method.
// The connected consumer part will call this method during its 
// PartCommunicationInit phase
// to pass initialization information to the provider Web Part. The 
// column names from the
// consumer Web Part are passed in. In this example, these values are 
// used to dynamcially 
// generate the input text boxes in the provider Web Part.
// <param name="sender">Consumer Web Part</param>
// <param name="filterConsumerInitArgs">The args passed by the 
// Consumer</param>

public void FilterConsumerInit(object sender, 
   FilterConsumerInitEventArgs filterConsumerInitEventArgs)
{
    if(filterConsumerInitEventArgs.FieldList != null)
        _fieldList = filterConsumerInitEventArgs.FieldList;
    else
        _fieldList = null;

    if(filterConsumerInitEventArgs.FieldDisplayList != null)
        _fieldDisplayList = 
           filterConsumerInitEventArgs.FieldDisplayList;
    else
        _fieldDisplayList = null;

}

See also

Reference

IFilterProvider interface

IFilterProvider members

Microsoft.SharePoint.WebPartPages.Communication namespace