How To edit the Group Quick Launch in SharePoint 2013 (and SharePoint Online)


If you’re customizing your SharePoint groups from C# code, like creating role definitions, sharepoint groups and role assignments, you’re likely that you need to put those new groups in the left navigation area, also called Group Quick Launch so that users can add users / AD groups to them when going to Site Settings -> People and Groups.

Seems that in SharePoint 2013 and the 2013 wave of SharePoint online there’s no direct way to manipulate the Group Quick Launch programmatically, other than directly manipulating the “vti_associategroups” web property.

Here’s how you can do it in a feature receiver:

if (web.AllProperties.ContainsKey("vti_associategroups"))
{
   string tempValue = web.AllProperties["vti_associategroups"] + ";" + currentGroup.ID.ToString();
   web.DeleteProperty("vti_associategroups");
   web.AddProperty("vti_associategroups", tempValue);
   web.Update();
}
else
{
   web.AddProperty("vti_associategroups", "currentGroup.Id");
   web.Update();
}