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

How to get the parent item in a Panel Bar

3 Answers 103 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 23 Sep 2008, 03:27 PM
Dear Telerik team,

Given a Rad Panel item, how can you get hold of its parent (in the hierarchy)?  I can't see an obvious property or method that does it, but presumably it's possible somehow.

Regards,

Ed Graham

3 Answers, 1 is accepted

Sort by
0
Ed
Top achievements
Rank 1
answered on 23 Sep 2008, 03:54 PM
I have managed to find a way to do this now:

    protected void ItemClicked(object sender, RadPanelBarEventArgs args)
    {
        RadPanelItem rpi = args.Item;
        RadPanelItem parent = rpi.Owner as RadPanelItem;
        ...
    }

Is there a better way?  I can't seem to find a ParentItem property or similar, which would be very useful ...

0
Accepted
Serrin
Top achievements
Rank 1
answered on 23 Sep 2008, 08:35 PM
This is the only way I can find, without iterating through the entire Panel piece by piece...  You can see the documentation on it at:

RadPanelItem Class Info

I couldn't find anything else on it either... did you need it for something that this current method won't work for?
0
Ed
Top achievements
Rank 1
answered on 28 Sep 2008, 09:21 PM
Thanks for the reply; my code is now working.  I was just surprised there wasn't a dedicated property, that's all.  You'd have thought it would be a common request, to find the parent of a panel item, and hence I expected there to be a dedicated property for it.  No matter!

Cheers,

Ed
Tags
PanelBar
Asked by
Ed
Top achievements
Rank 1
Answers by
Ed
Top achievements
Rank 1
Serrin
Top achievements
Rank 1
Share this question
or