0

I am trying to create a webpart through SPD 2010 on a list. Below are the steps which I followed:

  1. Open site in SPD
  2. Go to List.
  3. Edit list in designer.
  4. Go to Views.
  5. Click on one of the Views.
  6. Click Insert.
  7. Add it to Site Gallery (This adds it to miscellaneous)

Now I am trying to add this webpart into the page getting an error "An error occurred while attempting to add the item to the home page". Can any suggest me why am I getting this error. Is there any wrong step I am doing.

0

What are you trying to achieve? Why don't you just use the web interface to create a new view?

If you want to add a list view web part with that view to a web part page or a wiki page, you can then just select the view through the user interface.

SharePoint Designer is not required to do what you have described. I fact, the steps you outline above don't make any sense at all.

Create new list views in the browser GUI for the list. If you then want to insert a list view web part with this view into a page ( either Wiki or Web Part Page), just add a web part, select the list, select the view.

If you have a scenario where you want to show a list from a parent site in the sub sites, you will need to use a DVWP instead of a list view, and adjust its parameter setting to the absolute location.

Marc Anderson has the detailed steps in his blog post here:

http://sympmarc.com/2010/11/02/using-a-datasource-in-a-data-view-web-part-dvwp-in-a-different-site-in-sharepoint-designer-2010/

The pertinent bits are in the <Data Sources> tag, like this:

<SelectParameters>
      <WebPartPages:DataFormParameter Name="ListName" ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Announcements"/>
      <WebPartPages:DataFormParameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="/Marc"/>
    </SelectParameters>
  • Hi Teylyn, Thanks for your input. But the situation with me is that I want to use that webpart across the site. My list is at Top level and I would like to show the list data across site. So for accessing the data I have to create a webpart through which I can access them. – Ankit Jun 17 '13 at 5:51
  • No you don't. You just need to get a better understanding of how SharePoint works. You can create a specific view in the list/library (or not). Then on any other page, just insert a web part for the list/library. You can select one of the defined views, like your specific view, or you can customize the list view on that particular page. What is the problem? – teylyn Jun 17 '13 at 9:04
  • I have to add the webpart in the site collection.. We have various sites under that and the list is at the TOP level which can be access at any hierarchy. Do you think we can access the top level list as a webpart in the child site. -Thanks – Ankit Jun 17 '13 at 10:48
  • You need a DVWP instead of a List View. See my edits above. – teylyn Jun 17 '13 at 11:19
  • Thanks teylyn. I will check this and update the status. :) – Ankit Jun 20 '13 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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