About the "Selected Group" event

8 posts, 0 answers
  1. Marturo77
    Marturo77 avatar
    7 posts
    Member since:
    May 2007

    Posted 09 May 2007 Link to this post

    Hi. I am learning about the events that have the radPanelBar control.

    I need an event that give the selected GroupElement programatly.

    I will try by using the "Caption_Changed· Event and the "Region Event"  but i can't know the index or selected group.

    Thanks
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 09 May 2007 Link to this post

    Hi Arturo Duarte,

    When a group is expanded a GroupExpandedChanged event is fired. You could expand/collapse a group manually calling the PerformExpand method of  the group.  When you handle that event you could find which is the current expanded group checking its Expanded property. If Expanded is true then the group is expanded.
    If you need further assistance we will be happy to help you.

    Sincerely yours,
    Ray
    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. Marturo77
    Marturo77 avatar
    7 posts
    Member since:
    May 2007

    Posted 09 May 2007 Link to this post

    I can't view the GroupExpandedChanged in the radPanelBar control in the visual studio designer.  I have the Telerik 2007 Q1 winforms controls.

    With this event i can capture the index of the selected item?

    Thanks

  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 09 May 2007 Link to this post

    Hi Arturo Duarte,

    The GroupExpandedChanged event is an event of RadPanelBarGroupElement, not the RadPanelBar.
    Indeed you are able to get the current expanded group in that event because the sender argument is the group which fires the event. So you are able to cast the sender to RadPanelBarGroupElement and then get its index from RadPanelBarElement's Items collection . To do so you can subscribe all of your groups GroupExpandedChanged event to a single event handler using code like:
    foreach (RadPanelBarGroupElement group in this.radPanelBar1.PanelBarElement.Items) 
            group.GroupExpandedChanged += new   EventHandler(group_GroupExpandedChanged); 

    Then you could handle that event and retrieve the index of the group doing the following:
    void group_GroupExpandedChanged(object sender, EventArgs e) 
      if ((sender as RadPanelBarGroupElement) != null
      { 
        RadPanelBarGroupElement group = sender as RadPanelBarGroupElement; 
        int index = this.radPanelBar1.PanelBarElement.Items.IndexOf(group); 
      } 




    Regards,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Elie
    Elie avatar
    1 posts
    Member since:
    Jun 2007

    Posted 07 Jun 2007 Link to this post

    I have attempted to use the GroupExpandedChanged event, and the SelectedGroupChanged event and the event is being fired twice per group. How can I solve the problem. I want to have an event fires once when a group is selected.

    thx
  7. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 08 Jun 2007 Link to this post

    Hello Elie,

    It seems that you have hit a problem with our controls related to the GroupExpandedChanged event. We confirm that it is firing twice and we are going to fix it for the next release of RadControls for WinForms.

    We are sorry for the inconvenience. Your points have been updated.

     
    All the best,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Najoua
    Najoua avatar
    37 posts
    Member since:
    Jun 2007

    Posted 12 Jun 2007 Link to this post

    Hello,
    I don't really understand.I wanna use RadPanelBar for winforms in order to build an outlook-style windows form, so I have to define each event associated to each groupelement of the panelbar.
    I want to show a form for each GroupExpandedChanged event.
    Is it possible with your control?
  9. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 12 Jun 2007 Link to this post

    Hi Mlle,

    We currently have problems with the events in RadPanelBar which we will fix for the next major release of RadControls for WinForms.

    At present I can suggest an alternative solution: handle the mouse down event of each group's caption. To do that you will have to follow these steps:

    1) Subscribe to caption's mouse down event:

                 foreach (RadPanelBarGroupElement group in this.radPanelBar1.Items)
                {
                    group.Children[2].Children[0].MouseDown += new MouseEventHandler(Form1_MouseDown);
                }

    2) Get the group which was clicked on:

     void Form1_MouseDown(object sender, MouseEventArgs e)
            {
                RadPanelBarGroupElement group = (sender as FillPrimitive).Parent.Parent as RadPanelBarGroupElement;
            }


    If you need further assistance, please write back.
     

    Regards,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready