changing the style of RadPanelBarGroupElement

11 posts, 0 answers
  1. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 17 Oct 2007 Link to this post

    Hi All,

    Currently the RadPanelbarGroupElement[s] are displayed in a way that they are visible as seperate buttons kind of thing where we see the lines/borders around them.

    I have a requirement where I need the text of the RadPanelbarGroupElements to be displayed in such a way that they are blended with the background.

    For ex
    Consider this screen itself and assume it that its RadPanelBar.
    Now the way I want to dispay the group elements is as follows:

    RadGroupElement1

    RadGroupElement2

    RadGroupElement3



    Instead, I dont want it to be displayed with demarcations like:

    RadGroupElement1

    ---------------------

    RadGroupElement2

    ----------------------

    RadGroupElement3

    In all the sample applications of RadPanelBar, we see the group elements easily distinguishable with some boundaries.
    I need to show them boundary less.

    I hope i am able to explain the problem.If its not clear please let me knw and i will provide the screen shot of how i want the radpanelbar to look like.

    Looking forward for your help.

    thanks
    barkha
  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 18 Oct 2007 Link to this post

    Hello barkha,

    If I understand correctly what is it that you want to accomplish then you could try the following:
    1. Set the border of the group to be hidden
    2. Set the FillPrimitive of the caption of the group to be transparent
    ClassSelector groupBorderSelector = new ClassSelector("GroupBorder"); 
    BorderPrimitive groupBorder = groupBorderSelector.GetSelectedElements(this.radPanelBarGroupElement1)[0] as BorderPrimitive; 
    groupBorder.Visibility = ElementVisibility.Hidden; 
     
    ClassSelector groupFillSelector = new ClassSelector("GroupCaptionFill"); 
    FillPrimitive groupFill = groupFillSelector.GetSelectedElements(this.radPanelBarGroupElement1)[0] as FillPrimitive; 
    groupFill.BackColor = Color.Transparent; 
    groupFill.BackColor2 = Color.Transparent; 
    groupFill.BackColor3 = Color.Transparent; 
    groupFill.BackColor4 = Color.Transparent; 

    Hope that helps. Contact us again, if you have further questions.

    Sincerely yours,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 18 Oct 2007 Link to this post

    Thanks very much for the input.

    I am starting to thing that there are 2 ways to change the theme of any control:
    1) Either select the control in the visualbuilder and change the properties of it. Save the theme and use it as an embedded resource in the project.

    2) Programatically change the properties of the control with the help of classes like ClassSelector, FillPrimitive etc.

    Please let me know if I am understanding it right.

    Q1 - Which approach is the best way to change the theme of the controls?
    Q2 - I wanted to change the background color of the radPanelBar ScrollViewer from white to gray. So with the spy control, I could manage to see the change in the background color by changing the
    Telerik.WinControls.UI.RadScrollViewer : FillPrimitive : BacColor/2/3/4 to Gray.
    Now If i have to do this programatically , how will i achieve this?

     

                ClassSelector scrollViewerSelector = new ClassSelector("RadScrollViewFill");  
                FillPrimitive scrollViewFill = scrollViewerSelector.GetSelectedElements(this.radPanelBarGroupElement1)[0] as FillPrimitive;  
                scrollViewFill.BackColor = Color.Gray;  
                scrollViewFill.BackColor2 = Color.Gray;  
                scrollViewFill.BackColor3 = Color.Gray;  
                scrollViewFill.BackColor4 = Color.Gray;  
     

    Certainly, the code is wrong. I think I have selected the right class name but don't know exactly which control to give to FillPrmitive class to change the BackColor.

    Any help is appreciated always.

    Thanks
    barkha
  5. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 18 Oct 2007 Link to this post

    Also can you please tell me which is the appropriate place to write the above code. Should we write it in Form_load event.
    I have also attached the application in the support ticket system.

    Thanks
    -barkha
  6. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 18 Oct 2007 Link to this post

    Please pardon me If I am asking questions one after another. I am a beginner and just switched from native programming to .NET.

    I have one more question to ask:

    I am trying to change the look and feel of the radPanelBar control without applying Theme. Instead am trying to change the background color and text information programatcially.
    Now one thing in theme I found very easy which is to change the color when the mouse is moved over the control.
    I was wondering if that is achieved programatically also without applying the theme on the control.

    Also can I change the look and feel of the control using both the methods ( programatically as well as using Theme manager ).
    Whose changes will be overridden?

    Thanks in advance.

    barkha
  7. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 18 Oct 2007 Link to this post

    Please pardon me If I am asking questions one after another. I am a beginner and just switched from native programming to .NET.

    I have one more question to ask:

    I am trying to change the look and feel of the radPanelBar control without applying Theme. Instead am trying to change the background color and text information programatcially.
    Now one thing in theme I found very easy which is to change the color when the mouse is moved over the control.
    I was wondering if that is achieved programatically also without applying the theme on the control.

    Also can I change the look and feel of the control using both the methods ( programatically as well as using Theme manager ).
    Whose changes will be overridden?

    Thanks in advance.

    barkha
  8. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 19 Oct 2007 Link to this post

    Hello barkha,

    Yes, you are correct. In most cases visual properties of a RadControl can be modified in both ways.
    And yes, it is possible to change visual properties with code. The best way for this is using behaviors.

    For an example with behaviors, please see the following KB article:

    http://www.telerik.com/support/kb/article/b454K-thd-b454T-ckd-b454c-ckd.aspx

    If you want to make a simple change (for example - change a background color) it is more appropriate to do it with code. However, if you want to set a few properties or if you want to make changes based on a condition, then it is better to create a custom theme.

    Unfortunately, the background of the scroll thumb in RadPanelBar cannot be easily changed with code.
    Also, it seems that you want to change multiple aspects of RadPanelBar's visual appearance, so I would suggest that you create a custom theme.

    Contact us again, if you have any additional questions.

    Best wishes,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 19 Oct 2007 Link to this post

    Thanks Jordhan for introducing me to behaviours.

    I decided to chose the custom theme approach.

    So i placed radPanelBar on my form and open the visual style builder to create custom theme on it.
    What I see that the default PanelBarStyle chosen for the PanelPar is OutLookNavPane and what I need is the ExplorerBarStyle.
    The style doesn't even change if I change the default style to ExplorerBarStyle.

    Now please tell me how will I create custom theme on the control with ExplorerBarStyle. I think the class structure will be quite different in the both the case and if I change the theme of panelbar with even OutLookNavPane, then would the theme be still applicable to ExplorerStyle panel bar in the form?

    Please suggest.
    -barkha
  10. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 22 Oct 2007 Link to this post

    Hi Barkha,

    Thank you for writing.

    The RadPanelBar is shown in VisualStyleBuilder with the OutLookNavPane style in purpose. That is because this is the most complex RadPanelBar style and allows the visual properties for all elements to be modified.

    The element tree for the different RadPanelBar styles is in fact not so different. The RadPanelBar is designed to allow a common theme to be applicable to all the styles.

    I hope this helps. Contact us again, if we could be of further assistance.

    Regards,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. Abdulrahman Nabil
    Abdulrahman Nabil avatar
    12 posts
    Member since:
    Apr 2010

    Posted 01 Jun 2010 Link to this post

    Hello telerik Team ,
    For the same case i need to change the theme of the RadPanelBarGroupElement with a custom Shape ,but what i'm unable to do is to make that theme apply to Radpanelbar based only on the Group Style .for ex. I i set the same theme in one file for OutlookBar and ExplorerBar  style into one file and load them to diffrent controls, each one should take the sutable theme acording to StyleGroup.
    Is that doable ? and if not what would be the solution if i'm using themecomponent that apply one  saved theme file contais all my theme to all my application controls.
    please advice.

    Regards.



    Yours
    Abdulrahman Nabil
    Senior Technical Consultant
  12. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 08 Jun 2010 Link to this post

    Hi Abdulrahman Nabil,

    Thank you for the question.

    Concerning the themes, the look of the groups is not based on the GroupStyle of RadPanelBar. In other words, you cannot have different group styles in one and the same theme file. You need to create separate themes for the different styles that you want to achieve.

    Regards,
    Nikolay
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for WinForms is Visual Studio 2017 Ready