SharePoint Designer 2007—Adding more than One Web Part to a Custom Form

If you’ve created many custom forms in SharePoint Designer, it is likely that at some point you have used the DataViewWebPart to display data from a SharePoint list on your form.  They serve as a quick, simple way to throw data up on a page with the ability to scroll back and forth through the items in a list, or you can easily set filters based on the Query String, Server Variables, and a few other things.  

Well, what if you need to add more than one to the page to display data from more than one list?  Have you ever ran into the problem of not being able to add more than one Web Part to the page?  I was just about to go crazy a couple of days ago trying to figure out why SPD 2007 would not let me add more than one DataViewWebPart to a custom aspx page.  I kept clicking, refreshing data sources, closing and reopening SPD only to keep having that little “Insert Selected Fields As..” button to remain grayed out like this:

  or like this: 

Once I figured out what the issues were I couldn’t believe how simple the solution was, and I couldn’t believe how much time I spent trying to solve the issue.  Well, the first one (with “Item(s)” grayed out) was fairly simple to figure out.  Apparently SPD doesn’t like you trying to enter a second Web Part to a page while it is dirty, which means containing unsaved changes and is indicated by the little * on the page’s tab:

So, the answer in this case is to simply Save your page and then add the Web Part; however, the second one above was the real headache—with the whole button grayed out.  After a while of searching blogs I could find nothing about why SPD would not let me add a second DataViewWebPart.  Finally, I figured it out.

In the same way that Web Parts are added to a Web Part Page in the browser when designing a SharePoint page—the newest Web Part is always added to the top—SPD would not let me add a new DataViewWebPart BELOW the one that was already on the page.  As soon as I put my cursor above the other Web Part on the page the problem was solved.

So, to save yourself some time if you intend to add more than one Web Part to a page in SharePoint Designer, plan to add the Web Parts from the bottom up.  As a side note, as you hold down CTRL to choose the fields that you are going to add to the DataViewWebPart in the Data Source Details Pane be sure to click on them in the order that you want them to appear, and that is the order that they will be added to the page.  Just another simple time saving technique.  Have fun!

Advertisements
Previous Post
Leave a comment

2 Comments

  1. Henry

     /  June 5, 2009

    I was just beating my head on the wall for a couple of hours with this one. Thanks!

    Reply
  2. Jason

     /  June 11, 2009

    No problem, Henry. Glad to help. Sorry for the late reply.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: