Enabling ECB menu on a custom column in SharePoint 2013

Most of you would be aware of the fact that in SharePoint 2010 we could move the ECB menu on any custom column or for that matter a different columns than what was when the List/Library got created. There is a blog for the same (as below). http://blogs.msdn.com/b/chunliu/archive/2010/09/27/enabling-ecb-menu-on-a-custom-column-in-sharepoint-2010-part-1.aspx http://blogs.msdn.com/b/chunliu/archive/2010/09/29/enabling-ecb-menu-on-a-custom-column-in-sharepoint-2010-part-2.aspx As part of this blog we are going to see how to achieve the same in SharePoint 2013. The basic concept in SharePoint 2013 still remains the same as SharePoint 2010. However, Since the Design View has been removed from the SharePoint Designer 2013 hence I wanted to put across the modified steps to be performed in the absence of the Design View. Steps: As we all know by default the ECB menu is present on the Name column in case of a SharePoint Document Library and on the Title column in case of a SharePoint list. Here we are gong to take the example of a SharePoint Document Library. Note: The steps remain the same for a SharePoint List as well

  1. Navigate to the Document Library/List where you want to move the ECB menu to a different column. Ensure that the column on which you want to move the ECB menu is present in the view. In our example the column/field is Title

image

2.   Navigate to the Library Tab in the ribbon of the document library and select the Modify view in SharePoint Designer (Advanced) option image 3.   This will open the view in SharePoint Designer (Use SharePoint Designer 2013) image 4.   In the Editor locate the <View> element  as shown below image 5.   Under <View> locate  <ViewFields> and then the <FieldRef Name=”Title”> or the field where you want to enable the ECB menu and then add the attribute ListItemMenu=”TRUE” image 6.   Save the changes and visit your document library to verify that ECB has been enabled on the Title field. image

Set a Default View for a document library using Powershell

I have tried to elude myself from Powershell till now (really not sure why). However, finally the trend broke few days back when someone needed my help to do the following and I had o dive in

$site= New-Object Microsoft.SharePoint.SPSite ("http://siteUrl")
$web=$site.OpenWeb()
$list=$web.Lists["MyList"]
$view=$list.Views["MyView"]
$view.DefaultView = $true
$view.Update()
$list.Update()

Read email address of a SharePoint list/library programmatically

You can try SPList.EmailAlias property of a SPList object. It will return the email adress of the list as string

SPSite site = new SPSite("http://yoursite");
SPWeb web = site.OpenWeb();
SPList list = web.Lists[listGuid];
string emailAddress = list.EmailAlias;

Renaming the url of a document library

In SharePoint renaming a document library does not rename the url of the library. That’s how it is..

Having said that you can change the url of the document library by following the steps mentioned below

1.Open your site in SharePoint designer

2.It will list down all the lists/document libraries on the left hand side.

3.Highlight the document library in question

4.Click Rename (What ever you wish to…)to change the document library’s url

Renaming this way also changes the url of the library.