Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
RowProviderInit event
Collapse the table of content
Expand the table of content

IRowProvider.RowProviderInit event

NOTE: This API is now obsolete.

Sends the names and display names of the fields in the provided row.

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

[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartRow instead")]
event RowProviderInitEventHandler RowProviderInit

The event handler receives an argument of type Microsoft.SharePoint.WebPartPages.Communication.RowProviderInitEventArgs containing data related to this event. The RowProviderInitEventArgs properties FieldList and FieldDisplayList provide information specific to this event.

The following code example shows an overridden WebPart.PartCommunicationInit method that creates a RowProviderInitEventArgsobject, sets field names and display names, and then fires the RowProviderInit event. This code example is part of a larger example provided for the IRowProvider interface.

        // Step #7: Override the PartCommunicationInit() method.
        // The PartCommunicationInit method is called by the Web Part 
        // infrastructure during the ASP.NET PreRender 
        // event to allow the part to pass initialization information 
        // to the other connected parts.
        // It is important to always pass initialization information. 
        // Some parts may not behave properly if this initialization 
        // information is not received.
        public override void PartCommunicationInit()
            // Ensure that all of the Web Part's controls are created.

            // Check if connected.
                // If there is a listener, fire the RowProviderInit 
                // event.
                if (RowProviderInit != null)
                    // Create the RowProviderInitEventArgs object for 
                    // the RowProviderInit event.
                    RowProviderInitEventArgs rowProviderInitEventArgs = new RowProviderInitEventArgs();
                    // Set the row field names.
                    rowProviderInitEventArgs.FieldList = _rowFieldNames;

                    // Set the row field display names.
                    rowProviderInitEventArgs.FieldDisplayList = _rowFieldDisplayNames;

                    // Fire the RowProviderInit event.
                    RowProviderInit(this, rowProviderInitEventArgs);

© 2015 Microsoft