Question

I have a list which contains a column containing a URL. When viewing this list using the Datashseet view, I want the URL to open up in a separate or targeted window, so as to not redirect away from the Datasheet view. I'm not seeing any options to control Datasheet view URL rendering. Is there a way to do this? This is for SP2010 Server.

Was it helpful?

Solution

Follow these steps to accomplish your requirement:

  1. Create a column of type "Hyperlink or Picture" for your list (if it doesn't already exist)
  2. Add an item to the list with a valid URL in the new hyperlink column
  3. Open the list's "All Items" view in SharePoint Designer (SPD)
  4. Highlight the field containing the hyperlink and click "Code" (switches from Design to Code view)
  5. You will see something like this:

    <a href="{$url}"><xsl:value-of select="$url" /></a>

  6. Change that line to this:

    <a href="{$url}" target="_blank"><xsl:value-of select="$url" /></a>

  7. Save the view you have edited in SPD
  8. Return to the browser and refresh your page (with the list on it) and test

This will work for any subsequent list items added. Works in both standard and datasheet view.

Note that if you create a new view, you will need to make the same modification to that view in SPD for this to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top