Tag Info

Hot answers tagged

9

There are several ways to achieve this. I think the most preferrable way is to create a computed field. 1. Computed field The point is, actually there are 5 "Title" fields in any SharePoint list: First stores the data, the other 4 are Computed and simply generate some HTML, using data from the first column. You can use similar approach and add your ...


8

If you're including correctly main.xsl in your template, use $ServerRelativeUrl global parameter. Example: <td> <a href="{$ServerRelativeUrl}/Pages/mypage.aspx?MyID={@ID}"> Show </a> </td> MSDN reference for XSLT global parameters available here: http://msdn.microsoft.com/en-us/library/ff806158.aspx All these global ...


8

I'm not sure if XSLT 1.0 have today's date method. However, XSLT 2.0 has an equivalent current-date() Have you tried? ddwrt:Today() <xsl:value-of select="ddwrt:Today()"/> ddwrt:TodayIso() <xsl:value-of select="ddwrt:FormatDateTime(ddwrt:Today(),1033,'yyyyMMdd')"/>


8

When you add a DVWP to the page in SharePoint Designer, SPD defined a variable which contains the current date for you in the ParameterBindings section: <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/> Be sure to declare Today as a param at the top of the stylesheet: <xsl:param name="Today" /> Then you can ...


5

You can create a WebPart that will read data from a iCalendar file using a third party .Net assembly, I personally didn't used them before but here's the two of them I can think of right now, DDay.iCal and icalparser you can also use it to parse ICS file to text and then read it but its up 2 you For more information check these links out ...


5

Use the following URL to get XML of list:- http://{0}/_vti_bin/owssvr.dll?Cmd=Display&List={1}&XMLDATA=TRUE {0} – The URL to your site. This could be the root web or a child site. {1} – The GUID for your list. To find the GUID for a list, just go to the Settings page for the list and copy it from the URL. Use the following URL to get XML of ...


4

Don't be afraid of XSLT. This is going to give you a tremendous amount of power without having to develop or deploy anything in return for a little effort to understand it. I always recommend starting with an identity transform so that you can see the XML that is coming in, and then start adding templates to process the nodes you are interested in. Visual ...


4

The most obvious way for me would be to convert the column to type Number (List Settings -> click on the column name -> change type from "Single line of text" to "Number", then click "OK"), and then sort it in descending order (just modify sorting settings of the view). If you're trying to achieve this by using XSLT, then it seems you're looking for the ...


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 have created this in an application page, which is working fine. Please refer tto the code below that also has your part of code. using (SPSite site = new SPSite(SPContext.Current.Web.Url.ToString())) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists[MyList]; ...


4

Uninstall windows update KB2844286. Over the weekend I had to do this to two servers (much to my annoyance) but it did fix this problem. A server reboot was required. http://social.technet.microsoft.com/Forums/sharepoint/en-US/cc9a557b-93cd-40d5-965c-e0a2f107624d/unable-to-display-this-web-part-error-message-after-patch-kb2844286


4

I created three web parts connected together and filterable using Title: Choose a color -> Choose a fruit -> View fruit details. I created the following selector (jQuery required): $('img[alt="Selected"]').parent().next().children('div.ms-vb'); Which returns an array of the selected elements which have an ID attribute. You could then do a simple each ...


3

I learned the trick from Stefan Stanev's blog post on ListViewWebPart & SPView - two sides of the same coin. In a nutshell, you make a shallow copy (a clone) of the relevant view using a schema that's built as you want it to appear, and then force the clone view to be updated. That, in turn, causes the existing view to be updated. The key piece of ...


3

Original root template for XsltListViewWebPart comes from 14/TEMPLATE/LAYOUTS/XSL/vwstyles.xsl file. The code is as follows: <xsl:template match="/"> <xsl:choose> <xsl:when test="$RenderCTXOnly='True'"> <xsl:call-template name="CTXGeneration"/> </xsl:when> <xsl:when test="($ManualRefresh = 'True')"> ...


3

You might want to try to set the ListUrl instead. This works for me. So, do not set the ListId and ListName. ListUrl can be something relative like 'Lists/My List'. Regarding the view you might have an issue there as well. Try to not set the view at all - SharePoint will create a view automatically and see if the webpart works. Than you can try to get your ...


3

Unfortunately web parts added to a page do not maintain a link back to the .webpart files in the Web Part Catalog. You would have to go to each page and update the XSLT manually, or write some powershell script that can find and update the properties.


3

Content Query WebPart (CQWP) maybe a better choice for you. Try this: Insert a CQWP into your page, then Config the CQWP, select the Picture Library as the "Query" source, then Select "Created" as the "Group and Sort"'s sort column and check the "Descending" option, then Set "Limit the number of items to display" to 3, then In the "Style" section, select ...


3

The rendering of column headers could be customized using XSLT. The method described here represents one of the possible ways how it could be accomplished using SharePoint Designer (SPD) Solution In SharePoint Designer (SPD) open view page in Designer Mode. Select list header in List View that have to be customized and then click Customize Item as ...


3

You can create your own view and decide which fields to show in the view. The method below creates a StringCollection which can be passed to the method while creating view List.Views.Add() private StringCollection CreateViewColumns() { StringCollection viewFieldsCollection = new StringCollection(); string tasksColumns = "ID;Title"; ...


3

I believe it is related with invoking template for a field, it means that in your case this template is not invoked at all. In order to render field using your template the following attributes should be specified in template: a) mode DateTime_body b) match(matches field by internal name in that case) <xsl:template ...


3

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


3

To get a WebPart you use the Limited Web Part Manager The SPWebPartManager manages all the Web Part controls, functionality, and events that occur on a webpage.. For example using (SPLimitedWebPartManager wpm = web.GetLimitedWebPartManager(this.Page.Request.Url.AbsolutePath, PersonalizationScope.Shared)) { foreach ...


3

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


3

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


2

Doh. Found the answer I was looking for on this site. Basically: <SharePoint:AttachmentsField ControlMode="Display" ItemId="{@ID}" EnableViewState="true" FieldName="Attachments" runat="server"/>


2

Explicit attribute will hide the column in the webpart <FieldRef Name="LinkFilename" Explicit="TRUE"/>


2

The XSLT will basically draw a template of HTML which wraps the output of the data query. If you look through the XSLT you'll see various TR TD html elements around which draw the table. You will need to remove the TD elements which represent the column which you are trying to hide. This is easiest done with SharePoint Designer as you'll have the syntax ...


2

I know your error indicates the view, but error messages can often be misleading. Try setting the ListName, ListUrl, or ListDisplayName property instead of the ListID property. I haven't set any of these properties personally, but the MSDN Article XsltListViewWebPart and Custom List Views states the following: One of the List* properties (ListName, ...


2

When you expand the group, the listview webpart does callback(and not postback) to retrieve the data. While callback, the value of url parameter is not passed (unless you set a default value) and so you don't see data. To make it work : 1) Right click webpart 2) Go to webpart properties 3) Under "Ajax Options", Check "Enable Asynchronous update" 4) Click ...


2

By calling only <xsl:apply-templates/> you are not rendering anything after you render list title. In case you are editing some existing OOTB list view replace it with: <xsl:apply-templates mode="RootTemplate" select="$XmlDefinition"/> Where RootTemplate is template that renders 'everything else' and it is missing.... Some more info Use ...



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