In SharePoint 2010 you loose the list view selector in a list view if there are more than 1 web part in the page. This makes navigating the list views very cumbersome.
I have previously created a solution for adding a view selector in these list views, but that solution was a bit clunky.
I looked at this again today, and came up with a solution for re-enabling the missing list view selector that was clean and simple – and it doesn’t even require jQuery…
This is the first article where I’m using the “SharePoint 2010 Client Object Model”.
This solution is placed in a ContentEditorWebPart (CEWP) somewhere in the page you want the list view menu re-enable in. I recommend using the “Content Link” option in the CEWP as the code might be messed with by SharePoint if you paste it directly in the CEWP’s HTML-source.
To achieve this, put the code in a text-file and place it in a shares document library (all users must have read access), or in a folder created in SharePoint Designer. You then copy the file’s url and paste it into the “Content Link” field in the “Edit web part” panel like this:

You do not get any pictures of the menu itself as it is no different from the standard list view selector.
Here is the code:
Get the code here
October 28, 2011 at 2:55 am |
Perfect timing! Just encountered it yesterday and was wondering if there’s a way to solve this
October 28, 2011 at 12:32 pm |
Does Monkeysoft do things like this just to purposely annoy users?
November 15, 2011 at 7:48 pm |
Perfect timing for me too! Just face this issue today. Still need to try on my dev server. But one more issue is that ribbon for list view webpart won’t come up if we have more than one webparts on list view page. So, any idea what we can modify/add to script to make this working?
Thanks in advance,
Rajan
November 15, 2011 at 8:25 pm
Hi,
Glad you liked it. I’m not entirely sure what you mean by the ribbon not coming up. With more than one list view web part in the page, you need to select one list by clicking on it to bring up the ribbon.
Alexander
November 16, 2011 at 12:28 pm
Thanks for quick reply Alex.
I tried your code it works like charm and got my view selector back.
The issue i am talking about, please check my blog for more details. Here i can’t upload images to give you proper explanation.
Here is the link: http://wp.me/pTOaG-3W
December 4, 2011 at 1:17 pm
Hi,
Sorry, but I have no solution to this issue.
Alexander
November 16, 2011 at 12:18 pm |
[...] to Alexander Bautz Using his script i am able to solve first issue. But still 2nd issue is present. I don’t know [...]
January 12, 2012 at 2:56 pm |
For free: View Rescue for SharePoint 2010
http://www.pentalogic.net/sharepoint-products/free-sharepoint-web-parts/view-rescue
January 25, 2012 at 5:46 am |
Hello, Looks like the link to the code is broken. Thanks
January 25, 2012 at 7:41 am
Hi,
The redirect from my old to my new server failed. I have updated the link.
Alexander
January 25, 2012 at 9:13 pm |
I get nothing but an error: “document.getElementById(…)’ is null or not an object”
January 28, 2012 at 1:37 am
Hi,
Have the master page been modified?
Alexander