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

Selected color on RadPanelBarGroupElement

5 Answers 113 Views
Panelbar (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Peter Luth
Top achievements
Rank 1
Peter Luth asked on 03 Jun 2008, 08:14 AM
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?

5 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 05 Jun 2008, 02:27 PM
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
0
Peter Luth
Top achievements
Rank 1
answered on 06 Jun 2008, 09:48 AM
Thank you! It works great.

I personally believe this should be standard behavior, since you are trying to emulate "Outlook2007".
0
Nikolay
Telerik team
answered on 09 Jun 2008, 08:26 AM
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
0
Stargazer
Top achievements
Rank 2
answered on 19 Dec 2008, 11:44 AM
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...
0
Martin Vasilev
Telerik team
answered on 22 Dec 2008, 03:29 PM
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.
Tags
Panelbar (obsolete as of Q2 2010)
Asked by
Peter Luth
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Peter Luth
Top achievements
Rank 1
Stargazer
Top achievements
Rank 2
Martin Vasilev
Telerik team
Share this question
or