Sunday, March 11, 2012

How can I disable a CPE?

Hi,

how are you hiding the panel? Did you try setting display:none; for the panel?
I was disabling it or hiding it server-side

Panel1.Enabled = false

or

Panel1.Visible = false

I don't think either of them worked..

In the end I just created another div to hold both the panel and the CPE and set its .Visible property to false.

Still it would seem logical to include an 'enabled' property in the CPE itself..

Hi Bunce,

Take a look at theTargetProperties collection on your extender (i.e. theCollapsiblePanelExtender instance - not one of yourCollapsiblePanelProperties instances). You'll find bothRemove andClear methods that should take care of this for you.

Thanks,
Ted


This is exactly what I was looking for and this little snippet worked great.

1CssStyleCollection col = ContentPanel.Style;2if (!enabled)3 col.Add(HtmlTextWriterStyle.Display,"none");4else5 col.Remove(HtmlTextWriterStyle.Display);6HeaderPanel.Enabled = enabled;

No comments:

Post a Comment