Skip to main content

Click Mice, Unclick Mice

Go Search
Windows Live ID Authentication

Click Mice, Unclick Mice > Posts > Data View Web Parts bound to List Names


Data View Web Parts bound to List Names
Know them and love them.
I was working on a custom Wiki template the other day and I wanted more than anything not to have to package it as a WSP file.  I was trying my best to come up with a way to use my nice custom list dataview web part in a STP file, but SharePoint Designer loves more than anything to put the list GUID in to the dataview which pretty much makes the STP file a no can do item.  Which really meant that I was going to be forced to use a WSP just to use this dataview and to be able to get it to point at the correct list when it was provisioned.  I was just a little put off by the whole thing so I walked away from it for the night.
It was a bright and shining new morning though when I stumbled on a new piece of information.  SharePoint Designer had led me astray and had neglected to mention a new feature in the dataview.  They can be bound by List Name.  Maybe this isn't news to everyone, but I certainly didn't get the memo. 
In order to make use of this new handy feature its a simple find and replace in SharePoint Designer or your Data View Web Part editor of choice. 
  1. Open the web part definition in your editor of choice
  2. Look for all occurances of ListID in the web part definition and right next to that you should see a GUID. 
  3. Replace ListID with ListName and the GUID with the list name you want to bind to. 

I felt the need to share because this is something I wanted since WSSv2 and I had no idea it made the cut until last week.


I Didn't Get The Memo Either...

Fantastic!  Just what I needed.  I've spent ages building site template with a data view web part used to present data in a dashboard, and was pulling my hair out trying to get it to work in the provisioned sites.

Your instructions worked perfectly.  Absolute gold dust !!

Keith Bunge at 4/22/2008 11:50 PM


Thanks! This tip is a lifesaver for me! Crazy simple and amazingly useful!
Keith Bunge at 4/22/2008 11:50 PM

That's super, but...

This is perfect. But I'd need to keep the GUID of the list also. Is there a way of retrieving the appropriate List ID after you've made this change?
Keith Bunge at 4/22/2008 11:50 PM

Connected Dataview Web Parts

This works great; however, if you have two data view web parts that are connected and you package the site into an STP, the connections fail on when you provision a new site.  Has anyone solved this issue? 
Keith Bunge at 4/22/2008 11:50 PM