IFilterConsumer.ClearFilter 方法

请注意:此 API 现在已过时。

用来响应请求清除从ClearFilter事件提供程序 Web 部件的筛选器。

命名空间:  Microsoft.SharePoint.WebPartPages.Communication
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Sub ClearFilter ( _
    sender As Object, _
    e As EventArgs _
)
用法
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
)

参数

  • sender
    类型:System.Object

    对在提供程序 Web 部件上实现接口的对象的引用。

  • e
    类型:System.EventArgs

    从 ClearFilter 事件传递事件参数。这将是一个 NULL 对象。

示例

下面的代码示例显示将触发ClearFilter事件PartCommunicationMain方法的实现。此代码示例是示例的一个更大提供的IFilterConsumer接口的一部分。

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

另请参阅

引用

IFilterConsumer 接口

IFilterConsumer 成员

Microsoft.SharePoint.WebPartPages.Communication 命名空间