.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

XmlDefinitionLink in XsltListViewWebPart

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :C#

Has anyone ever succesfully used the XmlDefinitionLink property of the XsltListViewWebPart? I want it to point to a centralised XML definition, but I can't get it to work. No errors, but no result either.

MCTS in Web Application Development in .NET 2.0

View Complete Post

More Related Resource Links

Custom XSL stylesheet rendering for a XSLTListViewWebPart in SharePoint 2010

Hi, How can I apply the custom XSL rendering for the XSLTListView web part in SharePoint 2010? So, for example, I have a list of "Employees". Here is the list of columns I have for this Employee list - Full name, Job Title, Team, Contribution, Project. For this list I have created a new "List View" which has a grouping by Job Title. Then I have created a new page. In that page, I have added the Employees List and then in web part properties I have changed it to use the new List View (grouped by Job Title). I would like to control the HTML rendering of this web part and I don't know how do I achieve this? I do understand that by default a list view web part uses vwsytles.xsl and fldtypes.xsl stylesheets which are located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\XSL on the server. Should I grab these stylesheets and then change it and then point the web part to use these new ones? How do I change the web part to point to the stylesheets that I want to use instead of the default ones? I have also noticed that you can not even export the list view web part and change the properties and then import it back. I had a look at the web part properties (by clicking on "Edit Web Part"). The properties panel has "Miscellaneous" category which has the following properties - Sample Data, XSL Link etc

Xsltlistviewwebpart social tagging error on cross site list

Hi! I have exported an xsltslistviewwebpart through SPD 2010 and when asked if I want to show a specific list or parent path I choose specfic. I then import the webpart file on another site and this show the list perfect with ribbon and everything. But when I click the social tagging & notes I get a new popup with a error message in: "The page you selected contains a list that does not exist.  It may have been deleted by another user.<nativehr>0x81020026</nativehr><nativestack></nativestack>" This is the same error that I get if I try to import a xsltlistviewwebpart without making the correct export. If I click this button on the original listview I dont get the error and I can add tags. The same problems goes for the I like button.Findwise AB

XSLT customizations to done to XSLTListViewWebpart on site homepage and other pages are not saved

I am having a strange issue while applying simple XSLT customization to XSLTListViewWebpart SharePoint Server 2010 Beta All customizations are lost and not saved at al, here are the steps i am following to save my xslt customizations. Checkout the file --> right click Edit file in Advanced mode --> navigate to the XSLTListViewWebpart in context --> Customize Entire View/Item(tried both neither worked!) -->Add a simple span to show my tooltip on the anchor tag(where the folder name/item name is rendered) -->now i save the file and check in --> preview in browser --> changes dont show up --> so i close the page in SPD edit adn again click on edit in Advanced mode --> all my customiations are gone. Has anyone seen this ? is it because of some uninstalled required SP2010 updates?

xsltlistviewwebpart error

Hi there When I try to add the xsltlistviewwebpart webpart to a page I get the following error: "Attempted to use an object that has ceased to exist." I have no idea where to look to resolve the issue. Any pointers would be great! BWT we are running SP2010 foundation. thanks Jake

Custom OR Filter on XsltListViewWebPart

Hi, I am having some issues getting a custom document library that is being viewed in an xsltListViewWebPart to filter the way I want it to.   I have found 2 ways to filter down the list using user input. 1.) Add values to the FilterOperations collection based on user input. This works great when you are only trying to filter on one column, or narrowing down searches based on columns. My issue with this method is that I can't search for values in multiple columns (Can do Column1 and Column2 but NOT column1 or column2) 2.) Modify the xmlDefinition of the xsltlistviewwebpart and inject my own query into the xml. This works greats on actually filtering, I can filter down on whatever I want, however, when I do this, I lose ribbon functionality on all but the items that originally appeared on the first page. If you searched for something that returned the 1st and 1530th files in the list, you could use the ribbon on the 1st item, but all document specific ribbon controls are disabled for the 1530th file. There are thousands of documents in this library and the only reason you would search for it is because you want to edit the properties or something, so this is kind of a big deal.   What I am looking for is the best way to filter down the document library dynamically using OR statements and user input.   Any help would be greatly appreciated.

Programmatically creating a cross list XsltListViewWebPart

Hi, Does anyone know how to create a cross list XsltListViewWebPart in code? I can create a XsltListViewWebPart for a single list no problem. But if I don't set the ListId property and set the DataSourceMode to  SPDataSourceMode.CrossList I always get the error "Microsoft.SharePoint.WebPartPages.WebPartPageUserException : List View Web Part could not be added, list may be hidden.". I can't find much documentation on it. Does anyone have an idea how to get this to work? Thanks a lot,   Dan

XsltListViewWebPart: Document Library with Content Types

Good Morning, I have a requirement to add a webpart from a parent site to a child site to display a document library list view web part. Site structure eg: /parent/DocumentCenter /parent/ChildSite I have followed the instructions below as per http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/05c2c386-b6f3-4a4b-9641-e46d5bb3d4c2; 1) Open the parent site in SPD 2010.  2) Select "Lists and Libraries" from the left navigation pane 3) Select a list 4) In the "Views" section on the right, either open an existing view (e.g. AllItems.aspx) or create a new view. 5) In SPD page editor, click on the view. 6) In the Ribbon UI, go to List View Tools -> Web Part tab 7) Click "To Site Gallery" from "Save Web Part" section. 8) Give it a name and description (e.g. "ParentA") 9) Click "Yes" when the message pops up.  This ensures that the web part will point to the original source (i.e. main site) 10) In the browser, go to your subsite 11) Edit the page, insert web part through the browser ribbon. 12) Go to Miscellaneous section, and select the web part you saved. I have found if the document library is set to 'Allow Management of Content Types' the web part added to the child site will fail with the below error "Value does not fall within the expected range". As soon as i rem

Javascript error when creating XsltListViewWebPart programatically


Hi everyone,

I am receiving a Javascript error when attempting to use the context menu on any XsltListViewWebPart that is added to a page programatically.

The JS error is:


Message: 'listTemplate' is null or not an object
Line: 2
Char: 102472
Code: 0
URI: http://teamsite.domain.com/_layouts/1033/core.js?rev=c3ROI4x%2BKHVTMbn4JuFndQ%3D%3D

The code I am using to add the webpart to the page is:


private static void AddListViewWebPart(string siteCollUrl, string siteRelativeUrl, String pageUrl, string listName, string webPartTitle, String zoneId, int zoneIndex, string viewName, PartChromeType chromeType, string toolbarType)
  using (SPSite site = new SPSite(siteCollUrl))
   using (SPWeb web = site.AllWebs[siteRelativeUrl])
    SPLimitedWebPartManager lwpm = web.GetLimitedWebPartManager(pageUrl, PersonalizationScope.Shared);
    SPList list = web.Lists[listName];
    XsltListViewWebPart lvwp = new XsltListViewWebPart();
    lvwp.ListId = list.ID;
    lvwp.ViewGuid = list.Views[viewName].ID.ToString("B").ToUpper(CultureInfo.InvariantCulture);
    lvwp.AllowClose = false;
    lvwp.AllowConnect = false;
    lvwp.AllowEdit = false;
    lvwp.AllowHide = false;
    lvwp.AllowMinimize =

How to Customize XsltListViewWebPart ?


I added a Data View web part in a page using sharepoint 2010 designer .. it showed up as "XsltListViewWebPart".. I want to edit the xslt of the web part... to view the xslt I clicked the "Customize XSLT" (Customize Entire View) option in Design Tab of the designer. I edited the xslt and checked in the page but when I check for changes in the browser it did not show aany changes.... the XsltListViewWebPart just converted back in orginal form as it was added before customizing the web part.

XsltListViewWebPart is letting me change its xslt. Can I customize the xslt of XsltListViewWebPart ???

Adding XsltListViewWebPart on page / context menu issue in folders / SP2010



I have an issue with adding XsltListViewWebPart on a page for Document Library. When I do it using code below everything works fine unless I create some folder and upload a document there. Such documents have corrupted context menu.

When trying to open a menu I get javascript error:
"This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page."

When I use ListViewWebPart instead of XsltListViewWebPart everything is ok (but this solution is not acceptable).

Code I use:

using (var site = new SPSite("http://moss_server/ct4"))
                using (SPWeb web = site.OpenWeb())
                    SPFile page = web.RootFolder.Files["Defaul

Adding XsltListViewWebPart on page / context menu issue in folders / SP2010


I have an issue with adding XsltListViewWebPart on a page for Document Library. When I do it using code below everything works fine unless I create some folder and upload a document there. Such documents have corrupted context menu.

When trying to open a menu I get javascript error:
"This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page."

When I use ListViewWebPart instead of XsltListViewWebPart everything is ok (but this solution is not acceptable).

Code I use:

using (var site = new SPSite("http://moss_server/ct4"))
                using (SPWeb web = site.OpenWeb())
                    SPFile page = web.RootFolder.Files["Default.aspx"

Iterating through rows in xsltlistviewwebpart



I am using web part zone with xsltlistviewwebpart. Can someone tell me how to display all fields of my list, I am not an expert in xslt?

I have this, which iterates through rows:

<xsl:for-each select="$AllRows">
 Here Should go each field from each row delimited with br tag<br/>

But I don't know how to access fields from each rows of resultset.





Custom ribbon button on content type not shown in XsltListViewWebPart


Hello all,

As a bit of background: I'm currently busy developing a content type with some kind of status (waiting / in progress / done). I want to make the users life a bit easier to complete an item so I want to add a button to the ribbon that sets the selected items status to "Done".
This works when I go to the list and click on the item (I see my button and it works perfectly). The problem is that this button is not visible when I add a view of this list on the homepage, then suddenly my button does not show.

Does anybody know what can be done to also show the button inside the ribbon of the XsltListViewWebpart? Below is my elements.xml that I use.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  Title="Add a Ribbon Button">
     <Button Id="Ribbon.ListItem.Actions.NewRibbonButton"

Importing customized XsltListViewWebPart


Hi All,

I am working with the XsltListViewWebPart and I am facing the following issue:

I add a XsltListViewWebpart to my sharepoint page using the browser.
I open the page using SharePoint Designer 2010 and customize the xslt of the page.
I set the ddwrt:ghost attribute to 'always' and check my customization. My changes get reflected and everything works fine.

Now, I open the page in the browser and export my web part. I create a new page in the same sharepoint site and import my web part for this page, using the Import Web Part option. There is no error on import of web part. But when I try to add the webpart to the page an error is displayed stating "An error occured while trying ot add the item to the page". After that the web part is displayed correctly. And after that on the first post back of that page the design of the web part breaks i.e. whatever design customization I have added are displayed on the page without the list items. The list items in my xsltlistviewwebpart are displayed separately in the default design of the list.

On closer inspection I observed that the XmlDefinition of the XsltListViewWebPart is changed after importing the web part.

Any help will be appreciated.


Huzefa Mala.

Regards, Huzefa Mala.

XsltListViewWebPart Showing files from subfolder

Hi. We want to use XsltListViewWebPart for displaying contents of document library subfolder, i.e. we want it to show list of files in subfolder. We also want to send folder name to this web part through a web part connection. Is it possible or not?

XSLTListViewWebPart displaying incorrect formatting


I have a Linked Data Source that I'm rendering through a XSLTListViewWebPart using the XslLink property on one site. On a Subsite, I have another XSLTListViewWebPart. The second Web Part has different settings for the XslLink property, but is displaying the same formatting.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend