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

3 posts, 0 answers
  1. Ed
    Ed avatar
    124 posts
    Member since:
    Jan 2008

    Posted 17 Oct 2008 Link to this post

    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. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 17 Oct 2008 Link to this post

    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?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ed
    Ed avatar
    124 posts
    Member since:
    Jan 2008

    Posted 18 Oct 2008 Link to this post

    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
Back to Top