ICellConsumer.CellReady 方法
请注意:此 API 现在已过时。
连接 Web 部件的CellReady事件发生时,如选定或更新单元格时之后调用。此事件处理程序是类型CellReadyEventHandler。
命名空间: Microsoft.SharePoint.WebPartPages.Communication
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
<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
)
参数
sender
类型:System.ObjectWeb 部件的事件的源。
cellReadyArgs
类型:Microsoft.SharePoint.WebPartPages.Communication.CellReadyEventArgs事件数据。
示例
下面的代码示例显示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();
}
}