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

Expandable arrow on left hand side

4 Answers 160 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Brad H
Top achievements
Rank 2
Brad H asked on 11 Jan 2010, 04:07 PM
Is it possible to get the expandable arrows to appear on the left side of the text in my panelbar items?  I have been trying to figure this out to no avail.  Any help would be greatly appreciated.  Thank you.

4 Answers, 1 is accepted

Sort by
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#:
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-imagenone !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:

Protected Sub PanelBarLeft_PreRender(ByVal sender As ObjectByVal 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.
Tags
PanelBar
Asked by
Brad H
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Brad H
Top achievements
Rank 2
Jose Antonio Gonzalez
Top achievements
Rank 1
Srinivas
Top achievements
Rank 1
Share this question
or