Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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)
[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.
filterConsumerInitEventArgs
Type: Microsoft.SharePoint.WebPartPages.Communication.FilterConsumerInitEventArgs
A FilterConsumerInitEventArgs object which contains the field list and optional field display names sent to the consumer Web Part.

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

}

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.