IFilterConsumer.ClearFilter method
NOTE: This API is now obsolete.
用來回應要求清除從ClearFilter事件提供者網頁組件的篩選器。
Namespace: Microsoft.SharePoint.WebPartPages.Communication
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<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
Type: System.Object在提供者網頁組件實作介面的物件參考。
e
Type: System.EventArgs從 ClearFilter 事件傳遞事件引數。這會是一個 NULL 物件。
Examples
下列程式碼範例就會引發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;
}