Hi Jorge,
Found it. It can be set as a property of the file element within the module in 
elements.xml.
e.g.
<Module...
  <File...
    <Property Name="ChromeType" Type="chrometype">None</Property>
Incredibly useful MSDN reference with terrific examples [not]:
http://msdn.microsoft.com/en-us/library/aa544032.aspx

From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of 
Jorge Carvalho
Sent: Monday, 19 September 2011 9:32 PM
To: ozMOSS
Subject: RE: MOSS - Web Part chrome is locked

Hi Paul,
The CreatechildControls method creates the controls on runtime when the web 
part is rendered, not when it is provisioned.
You're resetting the Chrome type every time you display the web part.
You can define custom settings when you are provisioning the web part as part 
of a web template, or in a feature activated event receiver, I'm not sure how 
would you go about defining the default chrome for a particular web part 
though.... Anyone?
Cheers,
JC

From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of 
Paul Noone
Sent: Monday, 19 September 2011 9:37 AM
To: ozMOSS (ozmoss@ozmoss.com)
Subject: MOSS - Web Part chrome is locked

Hi all,
I'm sure I've done something silly but I'm unable to change the chrome settings 
for a custom web part via the UI.
They always revert to what I've defined in CreateChildControls.
protected override void CreateChildControls()
        {
            if (!error)
            {
                try
                {

                    base.CreateChildControls();
                    this.ChromeType = PartChromeType.TitleOnly;
                    Table table = new Table();
                    // etc...
                    row.Controls.Add(cell);
                    table.Controls.Add(row);
                    this.Controls.Add(table);
Is there a simple way to prevent this?

Kind regards,

Paul
_______________________________________________
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to