I was scratching my head figuring out a solution to restrict the view selection from pages that are generated for each views. My theory was there has to be a way to handle the view selector ?? I opened sharepoint designer to see if I can figure this out. I opened one of the existing view page for a list (AllItems.aspx) and then was looking for some kind of view selector control in the list webpart that was displayed. It took me few hours to figure out that only converting the list view webpart to the XSLT dataview will generate a selector control in the XSLT code, something like the line of code below.
<sharepoint:viewselectormenu runat="server" visible="false"”> </sharepoint:viewselectormenu”>
The line of code is the view selector control that is responsible to cause the switch, I simply added the visible attribute setting it to false to make the control unswitchable.
Other way would be to completely get rid of the control to give a clean user experience. It took few hours for me figure this out, but I am hoping this will help somebody do this quickly in this amazing world of sharepoint.
Add Content Edtior Web Part
ReplyDelete< style >
.ms-listheaderlabel {display: none;}
.ms-viewselector {display: none;}
< /style >
--fix the style tag .. I had to add spaces to get comment to accept it.
j6424