共用方式為


ICellConsumer.CellReady method

NOTE: This API is now obsolete.

後連線的網頁組件的CellReady事件發生時,例如選取或更新儲存格時呼叫。這個事件處理常式是類型CellReadyEventHandler

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

Syntax

'宣告
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartField instead")> _
Sub CellReady ( _
    sender As Object, _
    cellReadyArgs As CellReadyEventArgs _
)
'用途
Dim instance As ICellConsumer
Dim sender As Object
Dim cellReadyArgs As CellReadyEventArgs

instance.CellReady(sender, cellReadyArgs)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartField instead")]
void CellReady(
    Object sender,
    CellReadyEventArgs cellReadyArgs
)

參數

Examples

下列程式碼範例會示範CellReady事件處理常式的實作。這個程式碼範例是提供ICellConsumer介面的完整範例的一部分。

' Step #9: Implement the CellReady event handler.
' The connected provider part(s) will call this method during its 
' PartCommunicationMain phase
' to pass their primary data to the consumer Web Part.
' <param name="sender">Reference to the provider Web Part</param>
' <param name="cellReadyEventArgs">The args passed by the provider Web 
' Part</param>
Public Sub CellReady(sender As Object, cellReadyEventArgs As 
   CellReadyEventArgs) Implements ICellConsumer.CellReady
    ' Make sure child controls have been created.
     EnsureChildControls()
   
    ' Set the label text to the value of the cell that was passed by 
    ' the provider part.
     If Not (cellReadyEventArgs.Cell Is Nothing) Then
       _cellConsumerTextBox.Text = cellReadyEventArgs.Cell.ToString()
     End If
End Sub
// Step #9: Implement the CellReady event handler.
// The connected provider part(s) will call this method during its 
// PartCommunicationMain phase
// to pass their primary data to the consumer Web Part.
// <param name="sender">Reference to the provider Web Part</param>
// <param name="cellReadyEventArgs">The args passed by the provider Web 
// Part</param>
public void CellReady(object sender, CellReadyEventArgs cellReadyEventArgs)
{
    // Make sure child controls have been created.
    EnsureChildControls();

    // Set the label text to the value of the cell that was passed by 
    // the provider part.
    if(cellReadyEventArgs.Cell != null)
    {
        _cellConsumerTextBox.Text = cellReadyEventArgs.Cell.ToString();
    }
}

請參閱

參照

ICellConsumer interface

ICellConsumer members

Microsoft.SharePoint.WebPartPages.Communication namespace