I have added a custom web part on page.

Some how I am not been able to change its Chrome Type to None because when I mouse over the corner of web part where the arrow is supposed to show under which you see "Edit Web Part" option, the arrow is not displaying.

I don't know what the problem is, may be due to some javascript conflict the corner arrow for this web part is not being shown.

How do I set its chrome type through power shell or other means?


Try the following powershell code,

$site = new-object Microsoft.SharePoint.SPSite("http://Server:1111/")
$web = $site.OpenWeb("/")
$resultsPath = "Pages/default.aspx"
$page = $web.GetFile($resultsPath)
$wpm = $web.GetLimitedWebPartManager($resultsPath, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$wpm.WebParts | ft Title, StorageKey 
$refinerManager = $wpm.WebParts | Where-Object {$_.Title -eq "Webpart Title Name"}
Write-Host $refinerManager
$refinerManager.ChromeType = "None"
$wpm.SaveChanges($refinerManager)  #ERROR
Write-Host "Done"


Have a look at the below links to change the Chrome Type programmatically using c#,

  1. http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1289b677-ae77-45f5-8a21-176e42737ca9/how-do-you-programmatically-set-chrometype-of-web-parts-on-web-part-page?forum=sharepointdevelopmentlegacy

  2. http://www.sharemuch.com/2010/10/17/programmatically-changing-the-properties-of-webparts-and-views-in-sharepoint-2010/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.