This is a migrated thread and some comments may be shown as answers.

Problems theming PanelBar

3 Answers 19 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
stevesuk
Top achievements
Rank 1
stevesuk asked on 27 Jul 2008, 10:33 AM
I have themed a panelbar to have a 10 pixel border on all sides ... then I have enabled 'EnableHostControlMode' on a PanelBarGroupElement and a 'ContainerPanel' is added ... then I change the BackColor property of the ContainerPanel to match my themed PanelBar Color.

The problem is then:-

1. The container panel doesn't persist the new backcolor property.
2. The container panel doesn't recognise the themed properties so overlaps the border that was created in the theme.

(I also found that VSB doesn't include the ContainerPanel for theming)

Regards,
Steve.

3 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 28 Jul 2008, 01:42 PM
Hello stevesuk,

Thank you for writing us.

The right way to change the backColor of the panel is to set the ContentPanelHost's property BackColor

Here is a sample code:

    this.radPanelBarGroupElement1.ContentPanelHost.BackColor = Color.Red;

I confirm that the container panel is overlapping the borders.

Regarding the container panel theming. The container panel is a standard MS Panel control.  In Visual Style Builder we can edit only the visual elements from the control's elements hierarchy.

If you have any additional questions please write me back.

Greetings,
Boyko Markov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
stevesuk
Top achievements
Rank 1
answered on 28 Jul 2008, 04:54 PM

The right way to change the backColor of the panel is to set the ContentPanelHost's property BackColor

... I do this in the designer.but after running the app the color reverts to white ... it doesn't save it ... hence the statement:-

1. The container panel doesn't persist the new backcolor property

To me the theming of this control isn't really finished as the idea of theming is not to add code afterwards.

Steve.

0
Boyko Markov
Telerik team
answered on 31 Jul 2008, 07:34 AM
Hi stevesuk,

Thank you for contacting me.

How did you change this BackColor in the designer as the property ContentPanelHost is not visible? I mean the ContentPanelHost child, not the ContentPanel. Here is the code of the ContentPanelHost property:

       
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        [Browsable(false)]
        public RadHostItem ContentPanelHost
        {
            get
            {
                return contentPanelHost;
            }
            internal set
            {
                this.contentPanelHost = value;
            }
        }


The only way to set the backColor is to access this element through code and explicitly set its BackColor property, not through the designer.

I agree that we must think about improving the theming as designers should be able to edit every part of the control through the theming mechanism. Thank you about pointing this out.

Kind regards,
Boyko Markov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Themes and Visual Style Builder
Asked by
stevesuk
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
stevesuk
Top achievements
Rank 1
Share this question
or