Friday, March 30, 2012

How to set SharePoint 2010 web part chrome type to None programmatically

Sometimes you want to set the chrome type to none at the time of adding web parts to web part pages. Normally to set the chrome type to none, you will go to edit web parts and in the properties window you select the chrome type to none.

When you develop a custom web part in visual studio 2010, you can set this chrome type to none. So that the title will not appear at the time of web part adding.

To do this, open the .webpart file of relevant visual webpart, and set the following property under properties tag.

<property name="ChromeType" type="chrometype">None</property>

The complete .webpart file look like this.

 <?xml version="1.0" encoding="utf-8"?>


<webPart xmlns="">


<type name="Gadgets.Weather.Weather, $SharePoint.Project.AssemblyFullName$" />





<property name="Title" type="string">Weather</property>

<property name="Description" type="string">My Visual WebPart</property>

<property name="ChromeType" type="chrometype">None</property>





1 comment: