Hot answers tagged

8

I came across this today and found another workaround. When the web part is added to the page it creates a hidden view on the list it is bound to. You can get the hidden view and make the changes to it directly. This works for announcements, calendars and doc libraries from what I have tested so far. Example: private static void AddWebPart(Web web, ...


5

Just manage to find the answer as follows: Select the list view web part and modify it and remove the 'Title URL' under the 'Advanced' section will do. Reference: http://intl.feedfury.com/content/16270498-how-to-remove-the-web-part-title-bar-link.html


4

Don't know really HOW, but this code works! Take a look =) public partial class VisualWebPart1UserControl : UserControl { private Microsoft.SharePoint.WebPartPages.ListViewWebPart myListView; protected override void CreateChildControls() { base.CreateChildControls(); SPSite oSiteCollection = SPContext.Current.Site; ...


4

I suggest you check out SPServices. It's a "jQuery library which abstracts SharePoint's Web Services and makes them easier to use." http://spservices.codeplex.com/


4

Thanks Robert! I am banging my head on the wall for this! Basically you don't have to add a code just to show the ribbon by default. Just go navigation and tick NO to show or hide command ribbons. According to the error that i got below, it is referencing to a script outside our domain. Webpage error details Message: Script error Line: 0 Char: 0 Code: ...


4

In brief, just don't use XsltListWebPart on Application Pages. And here are some summarized explanations: XsltListViewWebPart and other OOTB SharePoint webparts (especially complex ones), apparently just aren't supposed to work in Application Pages environment. In other words, they weren't tested there and thus their operability is not guaranteed. This ...


4

I tested your code and I can confirm the behavior you described. There seems to be a bug where, no matter what XmlDefinition you specify, a webpart attached to a document library always ends up showing the default OOB view (Name, Modified, Modified By). If it were server object model, then it would be possible to cast the webpart to the underlying object ...


4

According to the HTML of WebPart Title, your jQuery should not work. HTML of WebPart Title looks like. <span title="Project List" id="WebPartTitleWPQ3" class="js-webpart-titleCell"> <h2 style="text-align:justify;" class="ms-webpart-titleText"> <a accesskey="W" href="/Projects/Lists/Project%20List"> <nobr> <span>...


3

You can do this by editing xslt in spd, namely you should change <xsl:value-of select> tag and add the surrounding <a> <a href="http://vxmc2170345/Lists/facilty/DispForm.aspx?ID={substring-after($thisNode/@IDofListX., '#')}"> <xsl:value-of select="substring-after($thisNode/@IDofListX. , '#')"/> </a> more detail: http://...


3

Ok I resorted to a jQuery solution as I can get my head around it easier than anything SharePoint throws at me! As all lists have the class ms-summarycustombody I was able to get the following to convert the table to ul var div = $("<div id='viewport' class='viewport'></div>"); var list = $("<ul id='announcementList'></ul>"); var ...


3

The only out-of-box WebPart that supports audience filtering by content item is the Content Query Web Part. It is part of the Publishing Infrastructure Site Collection feature and requires SharePoint Server edition (not included with Foundation). Add a CQWP to your page, wire it up to your linked list, and then click the checkbox to enable Audience ...


3

Not with OOTB default webparts. You can convert these to data view webparts and utilize multiple connections.


3

You can preview list item metadata on hover of list item. Like: Reference Links are Link1 Link2 Link3


2

fallout, I had the same problem and it was solved simply by using XsltListViewWebPart class instead ListViewWebPart. Hope that it helps,


2

myListView.ViewGuid = list.DefaultView.ID.ToString("B").ToUpperInvariant(); did the trick for you... If you set the ViewGuid property, it needs the Guid of the particular View Case sensitive!


2

Yes this is sharepoint OOTB error.. No solution for this If you want all users to have search enabled you can break permission and give them contribute permision at list level. Enable the show ribbon ->Always true


2

so, I resolved it with my colleague help, on create child controls I do following. Take schema xml from the view, overwrite query and pass it to list view. No new view is created and everything works. var obtainedList = elevatedWeb.GetListFromWebPartPageUrl(FullUrl); if (obtainedList == null) { throw new Exception(string.Format(ListFromUrlNotObtained,...


2

Since XsltListWebPart.ViewGuid and XsltListWebPart.XmlDefinition properties are ignored when adding web part via CSOM it makes it impossible to specify custom view for XsltListWebPart web part. Solution Since the default view is used when web part provisioned via CSOM, the proposed solution would be to modify default view during web part provisioning: ...


2

Try this. The url will take you to the display form of the item. (function () { var overrideContext = {}; overrideContext.Templates = {}; overrideContext.Templates.Header = "<ul id='local-news2'>" overrideContext.Templates.Item = CBody; overrideContext.Templates.Footer = "</ul>" SPClientTemplates.TemplateManager....


2

For targetting individual WebParts on one screen, and without jQuery document.querySelector(["#WebPartTitleWPQ2 nobr>span"]).innerHTML="New Title"


2

The difference between .dwp and .webpart The difference is .dwp was the file extension used in version 2 of SharePoint and .webpart is a new extension used in version 3. Inside the files, the schemas are different and it is indicated as such by the version number on the xmlns attribute.


2

This works in VIEWS on SP2010,13,16 & Online, and does not require jQuery or any extra JavaScript files or (Content Editor) WebParts Disclaimer: you need minor JavaScript skills (just to understand what you are copy pasting), and debugging this code is PITA The Lookup info you are after is actually available in the Context object once the VIEW has ...


1

Tom, For cross-site queries you can use SiteDataQuery Then you can use SPGridView to show results, here are some samples on using SPGridView... OOB AFAIK is not available what you trying to achieve, but when it comes to code - you CAN!


1

If you know the title of your list you could try something like this (here from Feature Event Receiver): var web = properties.Feature.Parent as SPWeb; if (web == null) return; var list = web.Lists["MyList"]; var manager = web.GetLimitedWebPartManager("MyPage.aspx", PersonalizationScope.Shared); var xsltListViewWebPart = new XsltListViewWebPart { ListId = ...


1

Finally I found the answer for this problem. I need to use XsltListViewWebPart instead of ListViewWebPart for the List View Web part in elements.xml


1

At site collection level, create a site lookup column(Say, TestColumnX) that refers to your list Say "TestListA" and point to the title field. On your child site, go to you desired list settings and add a new column based from an existing one. Pick the one you just created.


1

I've seen this problem before, on a Document Set homepage. The problem is that each webpart renders its own context object in DOM of the page, to be used in various javascript functions like sorting, paging, and also setting the ribbon. Despite extensive investigation the best answer I can give you is that you need to decide which of the webparts is most ...


1

First, I think Andrey hit the nail on the head. In addition, you could try to use the ListViewByQuery control on an application page if you are looking for a simple tabular layout of data (i.e. a list). Microsoft does this in the OOB workflow status page (i.e. _layouts/wrkstat.aspx) for display of tasks. I've not tried it with ECB menus and such, but ...


1

you can find the ListViewWebPart by code and set the HtmlSchemaView property by reflect. here is a open-source project : http://camlquery.codeplex.com/ you can find how to set the query condition of ListViewWebPart dynamically.


1

Edit the webpart file to set the default value using the property tag <property name="" type="">[value]</property> It probably isn't working because once it is altered you can't set the default property again in that webpart.



Only top voted, non community-wiki answers of a minimum length are eligible