I'm trying to alter the 'Site Collection Search Dropdown Mode' to show the search scopes drop down. I can achieve this via 'Site Settings' > 'Search Settings' but not through a sandbox solution.
I'm performing the following within the FeatureActivated function:
SPSite siteCollection = properties.Feature.Parent as SPSite;
if (siteCollection != null)
{
SPWeb topLevelSite = siteCollection.RootWeb;
// Set the search dropdown ode to show the scopes dropdown.
topLevelSite.AllProperties["SRCH_SITE_DROPDOWN_MODE"] = "ShowDD";
topLevelSite.Update();
}
Any pointers would be appreciated.