Tag Info

Hot answers tagged

8

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


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

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

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

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

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

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

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

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

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

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


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


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

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

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

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

I fixed this same problem by moving the View creation outside of the context of the SPLimitedWebPartManager: SPView view = CreateHiddenView(list); using (SPLimitedWebPartManager manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared)) { try { XsltListViewWebPart webpart = new XsltListViewWebPart(); webpart.ListName = ...


2

Currently, You have included "Title (linked to item with edit menu)" in the view of the list. Hence you see the drop down. Go to the list view and uncheck the column "Title (linked to item with edit menu)". You can use "Title" or "Title (linked to item)" . Then include this column in the data-view.


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


2

There are plenty of choices when it comes to bringing business data into SharePoint. 1. Business Connectivity Services This is recommended and the most legal way. Just create a web service and attach an external content type to it. Also you can use direct connection to a database. You can find a comprehensive article about BCS in MSDN Magazine: ...


2

Assuming that you used the default grouping options available in SharePoint lists: SharePoint already has this memorization behavior built in, and you are duplicating it. Here is what could possibly happen: when the page loads, SharePoint expands the node because this is the stored state your script does the same interpretation and collapses it back ...


2

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


2

Having read up on the interwebs, I came across this (awesome) post: Overriding the presentation of an xslt listview webpart which basically covers how to do what I was trying to achieve. The steps I took to get this right are as follows: Open up the page in SharePoint Designer and grab the xslt of the listview Save xslt into a .xsl file Update the ...


2

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



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