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

hierarchical Panel bar

1 Answer 37 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
A K
Top achievements
Rank 1
A K asked on 11 Aug 2010, 01:09 PM

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"

                        .DataBind()

                 

                  End With

1 Answer, 1 is accepted

Sort by
0
Simon Wolters
Top achievements
Rank 1
answered on 30 Aug 2010, 08:17 PM
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?
Tags
PanelBar
Asked by
A K
Top achievements
Rank 1
Answers by
Simon Wolters
Top achievements
Rank 1
Share this question
or