Creating an XSLT Data View Form web part without Sharepoint Designer

sharepointsharepoint-designer

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/

Best Answer

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..

Related Topic