Problems theming PanelBar

4 posts, 0 answers
  1. stevesuk
    stevesuk avatar
    6 posts
    Member since:
    Jan 2007

    Posted 27 Jul 2008 Link to this post

    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.
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 28 Jul 2008 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. stevesuk
    stevesuk avatar
    6 posts
    Member since:
    Jan 2007

    Posted 28 Jul 2008 Link to this post


    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.

  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 31 Jul 2008 Link to this post

    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.
Back to Top