Compartir a través de


del método IListConsumer.ListReady

NOTA: esta API está ahora obsoleta.

Proporciona un controlador de eventos para el evento ListReady de un elemento Web que implementa la interfaz IListProvider .

Espacio de nombres:  Microsoft.SharePoint.WebPartPages.Communication
Ensamblado:  Microsoft.SharePoint (en Microsoft.SharePoint.dll)

Sintaxis

'Declaración
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")> _
Sub ListReady ( _
    sender As Object, _
    listReadyEventArgs As ListReadyEventArgs _
)
'Uso
Dim instance As IListConsumer
Dim sender As Object
Dim listReadyEventArgs As ListReadyEventArgs

instance.ListReady(sender, listReadyEventArgs)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")]
void ListReady(
    Object sender,
    ListReadyEventArgs listReadyEventArgs
)

Parámetros

  • sender
    Tipo: System.Object

    Un elemento Web que implementa la interfaz IListProvider .

Comentarios

El método ListReady se ejecuta cuando se ha recuperado totalmente la lista consumida. También se puede ejecutar cuando la lista consumida cambios (por ejemplo, cuando se produce una adición, eliminación, actualización de una fila o cambio del filtro).

Ejemplos

En el ejemplo de código siguiente se muestra una implementación del método ListReady . Este ejemplo de código forma parte de un ejemplo más extenso de la interfaz IListConsumer .

' Step #7: Implement the ListReady 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="listReadyEventArgs">The args passed by the provider Web 
' Part</param>
Public Sub ListReady(sender As Object, listReadyEventArgs As ListReadyEventArgs) _
     Implements IListConsumer.ListReady
   ' Ensure that all of the Web Part's controls are created.
   
   EnsureChildControls()
   
   ' Store the List that was passed by the provider Web Part. 
   If Not (listReadyEventArgs.List Is Nothing) Then
      _dataGrid.DataSource = listReadyEventArgs.List
      
      'Bind the data grid
       _dataGrid.DataBind()

   End If
End Sub 'ListReady
// Step #7: Implement the ListReady 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="listReadyEventArgs">The args passed by the provider Web 
// Part</param>

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

    // Store the List that was passed by the provider Web Part. 
    if(listReadyEventArgs.List != null)
    {
        _dataGrid.DataSource = listReadyEventArgs.List;

        //Bind the data grid
        _dataGrid.DataBind();
    }
}

Vea también

Referencia

interfaz IListConsumer

Miembros IListConsumer

Espacio de nombres Microsoft.SharePoint.WebPartPages.Communication