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

RadPanelBarGroupElement Click event

2 Answers 64 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.
Derek
Top achievements
Rank 1
Derek asked on 19 Jan 2009, 11:55 AM
Hi,
Is it possible to add a handler for the RadPanelBarGroupElement Click event?  I don't want to have Items, just the group. Also id there a way to disable the expand/collapse images?

Thanks. 

2 Answers, 1 is accepted

Sort by
0
Derek
Top achievements
Rank 1
answered on 20 Jan 2009, 03:08 PM
Any Ideas? I'm very close to purchasing the controls but I'm struggling a little.
0
Deyan
Telerik team
answered on 21 Jan 2009, 09:01 AM
Hi Derek,

Thanks for writing and for your interest in RadControls for WinForms.

1. It is possible to achieve your goal regarding the RadPanelBarGroupElement Click. However, currently we have an issue with directly firing the event for this element. We were not aware of this issue, so thank you for bringing our attention to it.

Until this issue is addressed, please refer to the following code snippet as a workaround:

private void RadPanelBar_MouseUp(object sender, MouseEventArgs e) 
    RadElement element = this.radPanelBar1.ElementTree.GetElementAtPoint(e.Location); 
 
    if (element is RadPanelBarVisualElement) 
    { 
         for (int i = 0; i < this.radPanelBar1.Items.Count; i++) 
         { 
               if (this.radPanelBar1.Items[i].ControlBoundingRectangle.Contains(e.Location)) 
               { 
                     MessageBox.Show("Clicked on: " + this.radPanelBar1.Items[i].Text);                             
               } 
          } 
     } 

I am using the MouseUp event of the RadPanelBar. When this event is fired I am getting the RadPanelBarGroupElement on which the mouse was on and I am showing a MessageBox with the text of the group.

2. If you want to hide the collapse/expand images of the RadPanelBarGroupElements you could use the Edit UI elements action from the smart tag of the RadPanelBarGroupElement in the Visual Studio Designer:

Open the designer and select a RadPanelBarGroupElement. Open its smart tag and click on the Edit UI elements action. In the Element hierarchy editor use the TreeView on the left to find the Telerik.WinControls.UI.RadPanelBarCaptionButton element and select it. Use the Property Grid on the right and find the DisplayStyle property. Set it to "Text" - you will no longer see the expand/collapse image of the RadPanelBarGroupElement.

I hope this will help you. Your Telerik points are updated for reporting the 'Click'  issue.

I would be grateful if you could share with us your impressions regarding our controls. New ideas and suggestions are always welcome!

Do not hesitate to write back if you need further assistance or have additional questions.

Sincerely yours,
Deyan
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
Derek
Top achievements
Rank 1
Answers by
Derek
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or