Share via


IFilterConsumer.ClearFilter method

NOTE: This API is now obsolete.

Used to respond to a request to clear a filter from a ClearFilter event of a provider Web Part.

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

Syntax

'Declaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Sub ClearFilter ( _
    sender As Object, _
    e As EventArgs _
)
'Usage
Dim instance As IFilterConsumer
Dim sender As Object
Dim e As EventArgs

instance.ClearFilter(sender, e)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")]
void ClearFilter(
    Object sender,
    EventArgs e
)

Parameters

  • sender
    Type: System.Object

    A reference to the object that implements the interface on the provider Web Part.

  • e
    Type: System.EventArgs

    The event arguments that are passed from the ClearFilter event. This will be a NULL object.

Examples

The following code example shows an implementation of the PartCommunicationMain method that fires the ClearFilter event. This code example is part of a larger example provided for the IFilterConsumer interface.

' Step #10: Implement ClearFilter event handler.
' The connected provider part will call this method during its 
' PartCommunicationMain phase to remove the filter on the 
' consumer Web Part.
' <param name="sender">Provider Web Part</param>
' <param name="eventArgs">The Event Arguments</param>
Public Sub ClearFilter(sender As Object, eventArgs As EventArgs) Implements IFilterConsumer.ClearFilter
   ' Ensure that all of the Web Part's controls are created.
   EnsureChildControls()
         
   ' Clear the filter on the DataTable.
   _rowFilterExpression = String.Empty
         
   ' Clear out the cached row filter expression.
   _cachedRowFilter.Text = String.Empty
End Sub
// Step #10: Implement ClearFilter event handler.
// The connected provider part will call this method during its 
// PartCommunicationMain phase
// to remove the filter on the consumer Web Part.
// <param name="sender">Provider Web Part</param>
// <param name="eventArgs">The Event Arguments</param>

public void ClearFilter(object sender, EventArgs eventArgs)
{
    // Ensure that all of the Web Part's controls are created.
    EnsureChildControls();

    // Clear the filter on the DataTable.
    _rowFilterExpression = string.Empty;

    // Clear out the cached row filter expression.
    _cachedRowFilter.Text = string.Empty;
}

See also

Reference

IFilterConsumer interface

IFilterConsumer members

Microsoft.SharePoint.WebPartPages.Communication namespace