Profile

Cover photo
Rich Ross
Works at ePharmaSolutions
Attended Pennsylvania State University
Lives in Wallingford, PA
69 followers|31,505 views
AboutPostsPhotosVideos

Stream

Rich Ross

Shared publicly  - 
 
Can you answer this question?
1
Add a comment...

Rich Ross

Shared publicly  - 
 
At the January Philly.net meeting, I presented a Quick Tips session based on the SharePoint LINQ post. I started with a quick impromptu survey. How many people used LINQ, how many use S...
1
Add a comment...

Rich Ross

Shared publicly  - 
 
Mark you calendars - December 6th sees the new Xbox 360 dashboard update arrive. ...(read more)
1
Add a comment...
In his circles
79 people
Have him in circles
69 people
Prem vayu's profile photo
Mwesige Junior Richard's profile photo
maria teresa Ross's profile photo
Mamadou Makadji's profile photo
George Berosh's profile photo
Stack Exchange's profile photo
SSENTONGO BADRU's profile photo
Andrew Beno's profile photo
Michael Siegler's profile photo

Rich Ross

Shared publicly  - 
 
The Game Just Changed. By John Engates, CTO, Rackspace. We are thrilled to announce that Rackspace has acquired SharePoint911. SharePoint911 is a recognized thought-leader and authority in the SharePo...
1
Add a comment...

Rich Ross

Shared publicly  - 
 
One of the things you can now do with CAML in SharePoint 2010 is build a Join query. However, there are some limitations. The biggest limitation for using it to solve one of my problems...
1
Add a comment...

Rich Ross

Shared publicly  - 
 
ItemFieldIterator: Display Content from Different Web

The List Fields Iterator control provides an easy way to present list information dynamically on your page. Just point it to the ListId, set the control mode to New or if the item exists, Display or Edit while setting the ItemId. You do not need to know the names of the columns in your list, unless you do not want to display. This works great provided the list and the page are on the same SPWeb. The ListFieldIterator does have a Web property, but this is a Get or Read-only property, so there was no way to directly set this on the control. However, you can indirectly set it.

The ListFieldIterator contains a property called ItemContext. This property can be set with an SPContext object during the Page_Init method of the application page. There are a number of overloads for the SPContext.GetContext method and you can see them here. I picked the one that worked best for my scenario., which in this case is am SPWeb and ListId in my context.



using (SPSite oSPSSite = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb oSPWeb = oSPSSite.OpenWeb(string.Concat(oSPSSite.ServerRelativeUrl, "/mySite")))
{
Guid ListId = oSPWeb.GetList(string.Concat(oSPWeb.ServerRelativeUrl, "/", ListUrl)).ID;
NewDocumentItem.ItemContext = SPContext.GetContext(Context, 0, ListId, oSPWeb);
}
}



This is now the only property I needed to set for the control. I was setting the list id and item properties on the ListFieldIterator when the list was on the same SPWeb. The context now handles this. In working with this control, it looks like setting the list and item properties in addition to the ItemContext property confused the ListFieldIterator. It seemed to forget the ItemContext property and try to resolve the ListId based on the SPContext.Current properties.

One other note is that if you are saving new or updated information to the list, you will need to run the new or update code inside the SPSecurity.RunWithElevatedPriviledges block. This is because this portion of the page has a different context than the Form tag on the page, which is a security issue.
1
Add a comment...
People
In his circles
79 people
Have him in circles
69 people
Prem vayu's profile photo
Mwesige Junior Richard's profile photo
maria teresa Ross's profile photo
Mamadou Makadji's profile photo
George Berosh's profile photo
Stack Exchange's profile photo
SSENTONGO BADRU's profile photo
Andrew Beno's profile photo
Michael Siegler's profile photo
Education
  • Pennsylvania State University
    BS Biology
  • Thomas Jefferson University
    MS Microbiology
Basic Information
Gender
Male
Work
Occupation
Sr. SharePoint Solution Architect
Employment
  • ePharmaSolutions
    Associate Director, System Configurations, 2010 - present
  • Sanofi-aventis
    IT Project Manager, 2006 - 2010
  • Merck
    1996 - 2006
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Wallingford, PA
Previously
Ridley Park, PA
Links
YouTube
Other profiles
Contributor to