Michael Milazzo

Hi Everyone,

I two WSS sites that are on the same level. I would like to display the calendar events from one site, within the other site using the Gantt view. I figured out how to display list items from another site's list using a data view part, but I cannot use the Gantt view.

Is there a way to configure the calendar list of one site to display the calendar list items from the peer site

I figure this will make it easy to display them within a Gantt view using the calendar web part.

Thanks,

Mike



Re: SharePoint - Development and Programming Displaying list items in another site's list

AMANTE

You have almost the same problem as me.... displaying content af the list

Code Block

Imports System.Web.UI

Imports System.Web.UI.WebControls

Imports System.Web.UI.WebControls.WebParts

Imports System.ComponentModel

Imports Microsoft.SharePoint

Imports Microsoft.SharePoint.Administration

Imports Microsoft.SharePoint.WebControls

Public Class testing202

Inherits WebPart

Dim str As String

Dim lblprodCategory As Label

Protected Overrides Sub CreateChildControls()

Controls.Clear()

lblprodCategory = New Label

'Dim thisWeb As SPWeb = SPControl.GetContextWeb(Context)

'Dim list As SPList = thisWeb.Lists("Product Categories")

'For Each itm As SPListItem In list.Items

' str = str + itm("Product Category") + "<br>"

'Next

' lblprodCategory.Text = str

Dim listItems As SPListItemCollection = SPWebService.ContentService.WebApplications("Sharepoint-80").Sites("http://sharepoint.amante.local/sites/ASIA/Products/Product%20Maintenance/").OpenWeb("/").Lists("Product Categories").Items

For Each itm As SPListItem In listItems

str = str + itm("Product Category") + "<br>"

Next

MyBase.CreateChildControls()

End Sub

Protected Overrides Sub RenderContents(ByVal writer As System.Web.UI.HtmlTextWriter)

lblprodCategory.Text = str

writer.RenderBeginTag(HtmlTextWriterTag.Br)

lblprodCategory.RenderControl(writer)

End Sub

End Class

but it has a little error:

Object reference not set to an instance of an object. at testing202.testing202.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Troubleshoot issues with Windows SharePoint Services.