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

Getting Selected Group Element

2 Answers 97 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.
.
Top achievements
Rank 1
. asked on 05 Dec 2009, 12:55 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 10 Dec 2009, 09:21 AM
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.
0
.
Top achievements
Rank 1
answered on 12 Dec 2009, 09:29 PM
Thanks, that worked =)
Tags
Panelbar (obsolete as of Q2 2010)
Asked by
.
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
.
Top achievements
Rank 1
Share this question
or