Share via


IListConsumer.ListReady method

NOTE: This API is now obsolete.

Provides an event handler for the ListReady event of a Web Part that implements the IListProvider interface.

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

Syntax

'Declaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")> _
Sub ListReady ( _
    sender As Object, _
    listReadyEventArgs As ListReadyEventArgs _
)
'Usage
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
)

Parameters

  • sender
    Type: System.Object

    A Web Part that implements the IListProvider interface.

Remarks

The ListReady method is executed when the list being consumed has been entirely retrieved. It can also be executed when the list being consumed changes (for example, when an addition, deletion, update of a row, or filter change occurs).

Examples

The following code example shows an implementation of the ListReady method. This code example is part of a larger example provided for the IListConsumer interface.

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

See also

Reference

IListConsumer interface

IListConsumer members

Microsoft.SharePoint.WebPartPages.Communication namespace