hierarchical Panel bar

2 posts, 0 answers
  1. A K
    A K avatar
    49 posts
    Member since:
    Apr 2010

    Posted 11 Aug 2010 Link to this post

    I have 3 level hierarchical Panel bar. How Do I access Top level radpanelItems collection and inside top level second level panel item collection.

    I would like to set different font settings for Top most level and second level. I would also like to expand only Top most level panel items. How do I do this?

    I don’t see down arrow in the second level even if it has chid items it only show plain text when user clicks on it , it expands and shows child item. But I think I am supposed to see down arrow on right hand side indicating that it has child items. I see this arrow only on Topmost level.

    This is how I am binding the data to the panel bar


          With pnlbarCategory

                            .DataSource = dtCategory

                            .DataTextField = "Name"

                            .DataNavigateUrlField = ""

                            .DataFieldID = "Id"

                            .DataFieldParentID = "ParentId"

                            .DataValueField = "value"



                      End With

  2. Simon Wolters
    Simon Wolters avatar
    20 posts
    Member since:
    Mar 2010

    Posted 30 Aug 2010 Link to this post

    Unfortunately I can only provide C# code but I guess this might help you anyways: 

    You could register and handle the PanelBar.ItemDataBound event. This event is called every time an item has been bound to the RadPanelBar. The current item is exposed as EventArgument.

    protected void RadPanelBar_ItemDataBound(object sender, RadPanelBarEventArgs e)
       RadPanelItem createdItem = e.Item;
       createdItem.Expanded = false;
       if (item.Level == 0)
          createdItem.Font = MyFont1;
          // expand top level items only
          createdItem.Expanded = true;
       else if (item.Level == 1)
          createdItem.Font = MyFont2;

    I am not sure about the arrow icons but I once thought I had the same problem. In fact the container of the RadPanelBar just hid it because its padding wasn't set correctly. Have you tried this in different browsers and resized the container and/or PanelBar?
Back to Top