Getting Selected Group Element

3 posts, 1 answers
  1. .
    . avatar
    7 posts
    Member since:
    Aug 2009

    Posted 05 Dec 2009 Link to this post

    I have a PanelBar which have 5 group elements. I want to get an event whenever any of this items selected(expanded).

    I tried using GroupExpandedChanged and GroupSelectedChanged events of GroupElements but they both fire 2 events every time of selection.

    I just wanna get the text of the selected group element's caption.

    Thanks in advance
  2. Answer
    Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 10 Dec 2009 Link to this post

    Hi nesim yigit,

    The events that you mentioned are fired whenever a group changes its state. Since one group becomes expanded and another group becomes collapsed, one event is fired two times - once for each group.

    If you want only one global event which is fired only once during the expand/collapse operation, you need to subscribe to the events of RadPanelBar, for example PanelBarGroupExpanded:

    public Form1()
    {
        InitializeComponent();
      
        this.radPanelBar1.PanelBarGroupExpanded += new Telerik.WinControls.UI.PanelBarGroupEventHandler(radPanelBar1_PanelBarGroupExpanded);
    }
      
    void radPanelBar1_PanelBarGroupExpanded(object sender, Telerik.WinControls.UI.PanelBarGroupEventArgs args)
    {
        Console.WriteLine(args.Group.Caption);
    }

    I hope this helps. If you have additional questions, feel free to contact me.

    Sincerely yours,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. .
    . avatar
    7 posts
    Member since:
    Aug 2009

    Posted 12 Dec 2009 Link to this post

    Thanks, that worked =)
Back to Top