0

The Problem:

We have a top level site that contains various lists of data. The information in these lists are exposed to subsites using site lookup columns. In our subsites we have various lists that use a few of these site lookup columns.

Each of the subsites has an XSLT Listview webpart on the homepage so that management will have a quick overview of the information.

The problem is that the values of the lookup columns is always blank in the webpart. The actual list displays the values perfectly and as expected.

Here is an example just for clarity purposes.

On the top site which is the first site in the collection, we have a custom list called "Available Employers". We maintain just the default Title field with the names of the Employers and have some further custom fields for telephone, email etc. We then created a site column (also in this top site), of type lookup, called "Employing Partner" which points to the Available Employers list with the Title field set to display.

In our subsite we have a custom list called Students which stores information about a Student. We added Employing Partner from the existing site columns. This works 100% in the New/Edit forms and also in the views associated with the list. It just doesn't work when adding the built in webpart for that list to a webpart page.

The Question:

I know the webpart and the view used on the webpart are not the "same" view based on http://blogs.msdn.com/b/arindam/archive/2012/04/13/a-quick-look-at-list-views-and-list-view-web-parts.aspx

To me it seems like there is no relationship between the webpart and the top site like there is in the actual list.

Is there any way around this or will an alternative method need to be explored to display the information correctly on the home page?

Kind regards,

Rick

2
  • Tried it myself and works perfectly for me. I added a list view webpart on the home page of the subsite and I could see the lookup column info. Sep 5, 2013 at 7:09
  • I've tested this on two other SharePoint installations now and can't seem to replicate the issue. This is going to be a tough one to figure out. Thanks for the feedback Nadeem.
    – Rick
    Sep 5, 2013 at 14:58

3 Answers 3

1

Rick,

As per my knowledge, there is no OOB way to use cross-site lookup columns.. However when this requirement comes to me, I usually save ID of the root-site list item and use custom SPGridView to show custom List View, where I replace the ID with actual Title and Hidden Field to store the ID as well (if any operation needs to be performed within the grid)

If you want to see examples of SPGridView, please see
Samples on how to use SharePoint's GridView

PS: Please wait for other answers, I am not sure if there is anything like cross-site lookup columns OOB available, but if you search on Google you will find some codeplex and other Projects people have done to achieve it!

1
  • Hi Arsalan, thanks for the feedback. Just to clear any confusion it's not cross site as such but only from Parent to child which does work correctly but creating the list on the top site, creating a site column at the top site level as a lookup to the list. These site columns that are created at the top site are available for use within the subsites. This all works 100% when adding items to the subsite and viewing the list views. The issue comes in when we add the list view web part to a webpart page. That is when the lookup values dissapear. Hope that makes sense.
    – Rick
    Sep 4, 2013 at 11:35
0

This seems to be something wrong with the home page that the webparts are added to. I created another page under the Site Pages gallery, added the webparts and set the page as the default which seems to resolve the issue. No idea what is wrong with the original default page on this instance but this will have to do.

0

I've just spent a full day on what seems to be the same issue.

I'm a complete novice to this, but I finally figured out that since the XLV is a subview to the ListView, you can't use any columns that are not in that. I.e. you have to make a view that contains all the columns you want to use before your XSL stylesheet can use them.

Furthermore, the columns, particularly long lookup site columns, tend to have their names cut-off, so I recommend doing an XSL lookup that pulls the entire XML so you can see their real names.

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.