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

How do I set group height for *root-level* items?

2 Answers 47 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 17 Oct 2008, 05:42 PM
I know that you can control the height of various child nodes in the RadPanelBar item tree by using the ChildGroupHeight property; for example:

    foreach (RadPanelItem rpi2 in rpbLHNav.Items)
    {
        // set height of second-level items
        if (rpi2.Items.Count > 7)
        {
            rpi2.ChildGroupHeight = Unit.Pixel(250);
        }
        // set height of third-level items
        foreach (RadPanelItem rpi3 in rpi2.Items)
        {
            if (rpi3.Items.Count > 11)
            {
                rpi3.ChildGroupHeight = Unit.Pixel(250);
            }
        }
        ...
    }

Is there a way to control the height of the root items (i.e., those in rpbLHNav.Items) in a similar way?  (The ChildGroupHeight property is missing from the RadPanelBar object.)

2 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 17 Oct 2008, 07:12 PM
Hey Ed,

Not sure if this is quite what you're looking for... but it looks like you can set the height of each individual rpi2, for example:

...  
 foreach (RadPanelItem rpi2 in RadPanelBar1.Items)  
        {  
            rpi2.Height = Unit.Pixel(90);  
            // set height of second-level items  
            if (rpi2.Items.Count > 3)  
... 

When this runs through, each root item height is changed (since you're already going through the list of items I only had to add one line of code to your example :D).  Does that fit the bill for what you're looking for?
0
Ed
Top achievements
Rank 1
answered on 18 Oct 2008, 08:34 AM
Hi Serrin,

Thanks a lot for your reply.  It isn't quite what I needed but I see that I didn't explain it very clearly!

I need to set the group height for a set of items, rather than the individual height of each one.  This is because the skin I am using (similar to the Inox skin) creates a scroll-bar if a group of child items goes beyond the specified height.  My panel bar has several root items, and so I need a way of setting a height limit for these (collectively) so that the scroll-bar appears if they go beyond it.

Cheers,

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