handling events for radPanelBar

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

    Posted 23 Oct 2007 Link to this post

    Hi,

    I want to do some action on click of the RadPanelBarGroupElement just as we do some action on click of its contituents controls ( RadButtonElement / hosted controls ).

    From the documentation , I learned that RadPanelBarGroupElements have only 2 events.
    1) RadPanelBarGroupElement.GroupExpandedChanged
    2) RadPanelBarGroupElement.GroupSelectedChanged 

    None of these events are helping me because they are fired also when the form is loaded and when the group is deselected.

    I just want to load one form ( add a usercontrol ) on click of RadpanelBarGroupElement.

    I tried to add an event on Action --> click , but the event doesnt get fired on clicking the RadpanelBarGroupElement.

    Can someone please tell me how can i have same behavior of  (click on RadButtonElements ) on RadpanelBarGroupElement as well without the events getting fired multiple times.

    Thanks
    barkha
  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 24 Oct 2007 Link to this post

    Hello Barkha,

    You could try subscribing for the MouseDown event of the FillPrimitive in a group's caption in the following way:

    protected override void OnLoad(EventArgs e) 
        base.OnLoad(e); 
     
        ClassSelector captionFillSelector = new ClassSelector("GroupCaptionFill"); 
        FillPrimitive captionFill = captionFillSelector.GetSelectedElements( 
            this.radPanelBarGroupElement1)[0] as FillPrimitive; 
     
        captionFill.MouseDown += new MouseEventHandler(captionButton_MouseDown);  
     
    void captionButton_MouseDown(object sender, MouseEventArgs e) 
        MessageBox.Show("Mouse Down"); 

    If you do not want to be notified when the user clicks on a group's caption but on the group content panel, you could try handling the MouseDown event of that group. However this approach might or might not work depending of the content of the group.

    Contact us again, if you need any further assistance.

    All the best,
    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
Back to Top