4 Answers, 1 is accepted
0
Accepted
Princy
Top achievements
Rank 2
answered on 12 Jan 2010, 11:49 AM
Hello Brad,
You can use the following code to dispplayimages on the left side of the panelbaritems
c#:
And to hide the arrows on the right hand side, try the following css setting:
css:
Hope this helps..
-Princy.
You can use the following code to dispplayimages on the left side of the panelbaritems
c#:
protected void RadPanelBar1_PreRender(object sender, EventArgs e) |
{ |
foreach (RadPanelItem item in RadPanelBar1.Items) |
{ |
if (item.Items.Count > 0) |
{ |
item.ImageUrl = "~/Images/Image1.gif"; |
item.ExpandedImageUrl = "~/Images/Image2.gif"; |
foreach (RadPanelItem subItem in item.Items) |
{ |
if (subItem.Items.Count > 0) |
{ |
subItem.ImageUrl = "~/Images/Image1.gif"; |
subItem.ExpandedImageUrl = "~/Images/Image2.gif"; |
} |
} |
} |
} |
} |
And to hide the arrows on the right hand side, try the following css setting:
css:
.RadPanelBar_Default .rpExpandable .rpText, .RadPanelBar_Default .rpExpanded .rpText |
{ |
background-image: none !important; |
} |
Hope this helps..
-Princy.
0
Brad H
Top achievements
Rank 2
answered on 12 Jan 2010, 05:30 PM
Thank you. This has helped tremendously! Here is the VB code in case anyone needs it:
Thanks again!
Protected Sub PanelBarLeft_PreRender(ByVal sender As Object, ByVal e As EventArgs) |
For Each item As Telerik.Web.UI.RadPanelItem In PanelBarLeft.Items |
If item.Items.Count > 0 Then |
item.ImageUrl = "~/global/images/sidenav_closed_arrow.png" |
item.ExpandedImageUrl = "~/global/images/sidenav_open_arrow.png" |
For Each subItem As Telerik.Web.UI.RadPanelItem In item.Items |
If subItem.Items.Count > 0 Then |
subItem.ImageUrl = "~/global/images/sidenav_closed_arrow.png" |
subItem.ExpandedImageUrl = "~/global/images/sidenav_open_arrow.png" |
End If |
Next |
End If |
Next |
End Sub |
Thanks again!
0
Jose Antonio Gonzalez
Top achievements
Rank 1
answered on 13 Jan 2010, 12:12 AM
Here is a recursive way to do the same for all levels, not only the first 2 levels...
protected void _radPanelBar1_PreRender(object sender, EventArgs e) |
{ |
foreach (RadPanelItem item in _radPanelBar1.Items) |
{ |
SetArrows(item); |
} |
} |
protected void SetArrows(RadPanelItem Item) |
{ |
if (Item.Items.Count > 0) |
{ |
Item.ImageUrl = "~/Images/Arrow1.gif"; |
Item.ExpandedImageUrl = "~/Images/Arrow2.gif"; |
foreach (RadPanelItem _item in Item.Items) |
{ |
SetArrows(_item); |
} |
} |
} |
0
Srinivas
Top achievements
Rank 1
answered on 14 Mar 2011, 07:12 PM
Awsome friends ! This is what I was looking for.