Selected color on RadPanelBarGroupElement

6 posts, 1 answers
  1. Peter Luth
    Peter Luth avatar
    26 posts
    Member since:
    Aug 2007

    Posted 03 Jun 2008 Link to this post

    Hello,

    I am using the Outlook 2007 style on RadPanelBar. It is missing one thing from Outlook though:

    When you have selected a RadPanelBarGroupElement, it is not highlighted in color. The color disappears when you remove the mouse cursor.

    Is it somehow possible to resemble this behaviour?

  2. Answer
    Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 05 Jun 2008 Link to this post

    Hello Martin Bo,

    Thank you for writing.

    In order to implement this appearance, you should set appropriate colors for the selected group in the RadPanelBar_PanelBarGroupSelected event handler and to reset the colors of the last selected group.

    Please refer to the following code snippet:

    public partial class Form1 : Form  
    {  
        RadPanelBarGroupElement lastSelected = null;  
     
        public Form1()  
        {  
            InitializeComponent();  
        }  
     
        private void radPanelBar1_PanelBarGroupSelected(object sender, PanelBarGroupEventArgs args)  
        {  
            if (lastSelected != null)  
            {  
                RadPanelBarVisualElement resetCaption = lastSelected.GetCaptionElement();  
                resetCaption.ResetValue(VisualElement.BackColorProperty);  
                resetCaption.ResetValue(LightVisualElement.BackColor2Property);  
                resetCaption.ResetValue(LightVisualElement.BackColor3Property);  
                resetCaption.ResetValue(LightVisualElement.BackColor4Property);  
            }  
     
            RadPanelBarVisualElement groupFill = args.Group.GetCaptionElement();  
            groupFill.BackColor = Color.Yellow;  
            groupFill.BackColor2 = Color.Orange;  
            groupFill.BackColor3 = Color.Orange;  
            groupFill.BackColor4 = Color.Orange;  
     
            lastSelected = args.Group;  
        }  

    I hope this helps. If you have additional questions, do not hesitate to contact me.

    Kind regards,
    Nikolay
    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. Peter Luth
    Peter Luth avatar
    26 posts
    Member since:
    Aug 2007

    Posted 06 Jun 2008 Link to this post

    Thank you! It works great.

    I personally believe this should be standard behavior, since you are trying to emulate "Outlook2007".
  5. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 09 Jun 2008 Link to this post

    Hi Martin Bo,

    Thank you for the feedback.

    We agree with your observation. We will consider implementing this feature in the future.

    Regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Stargazer
    Stargazer avatar
    73 posts
    Member since:
    Jan 2007

    Posted 19 Dec 2008 Link to this post

    Is this already available in the latest version?

    I think it is not... Maybe, a usefull way would be to make possible to define this via the Theme...
  7. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 22 Dec 2008 Link to this post

    Hi Stargazer,

    Thank you for contacting us.

    We are agree that it will be useful feature if this could be set through the theme. Current version does not support this but we will add it in some of the next release. Currently, you could use the code provided in previous message to implement such of behavior.

    If you have other questions, do not hesitate to contact me again.

    Kind regards,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready