3

With Sharepoint Designer there is a feature that allows you to convert a web part list to an XSLT Data View (right click on the web part in SPD and click 'Convert to XSLT Data View'). I need to be able to mimic the control that is being created with this process (from what I can tell it should be Microsoft.Sharepoint.WebPartPages.DataFormWebPart). My host does not allow the use of SPD, so this webpart must either be out-of-the-box or bundled into a WSP. Unfortunately I am not finding a way to do this.

Things I have tried:

  • Saving the web part as a .webpart in SPD then deploying it as a custom web part. I get an error when attempting to add the web part to my site 'Type not found or is not safe' (something like that). The Microsoft.Sharepoint.WebPartPages.DataFormWebPart is not safe?

  • Creating a DataViewForm web part through the browser and adding the same XSLT/Parameter code that is stored with the web part converted using SPD. Adding the code does not appear to have an effect (nothing happens).

  • For testing purposes I converted a list web part to an XSLT Data View using SPD, then modified the XSLT/Parameter code through the browser just to see what would happen, and it worked fine. I think that at least gives a clue that the pasting in the code like this should work..

My goal is to be able to create a menu system similar to this (which uses spd to create it): http://blog.pathtosharepoint.com/2009/01/15/a-drop-down-menu-the-sharepoint-way/

ferr
  • 1,137
  • 3
  • 12
  • 28
  • Made some progress. Removing the ViewFlags value in the .webpart, then adding the .webpart through the browser works (otherwise I get a view is invalid error). I still get the type not found error with a wsp deployment of the same .webpart – ferr Mar 09 '11 at 14:51
  • Aplying the viewflags fix to the .webpart and deploying it through a wsp gives me a new error "Unable to display Webpart ... The server returned a non-specific error when trying to get data from the data source" – ferr Mar 09 '11 at 15:05
  • Are you using SharePoint 2007 or 2010? If it's 2007, I'm surprised a host would allow .wsp deployment but not SharePoint Designer access. Have you looked at fpweb.com – Tom Resing Mar 10 '11 at 02:56
  • 1
    It looks like modifying the ViewFlags (just setting it to empty) was good enough. The additional error was due to the list guid not being correct in the webpart code. Once the ViewFlag property is changed it works via wsp deployment and .webpart import via browser. – ferr Mar 10 '11 at 13:52

1 Answers1

-1

look at the article posted here: http://tjassens.com/?p=37 This describes how to make a xslt dataform/dataview webpart programmatically with multiple datasources (SPLists) and also how to pass parameters dynamically to the webpage..

Tjassens
  • 922
  • 6
  • 9