+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / Customizing Site Panel Bar

Customizing Site Panel Bar

2 posts, 0 answered
  1. WebGeek
    WebGeek avatar
    186 posts
    Registered:
    20 Dec 2006
    12 Mar 2010
    Link to this post
    For my menu items I will need different background colors based on their order. For example:
    Even - Yellow Background
    Odd - Green Background

    Does anyone have any suggestions on how I can pull this off using Site Panelbar?

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    12 Mar 2010
    Link to this post
    Hi medicalwebgeek,

    Below is a sample code that you can use to identify odd and even items

    protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            foreach (RadPanelItem item in RadPanelbar1.GetAllItems())
            {
                if (item.Level % 2 != 0)
                {
                    item.Text = "Even";
     
                }
                else
                {
                    item.Text = "Odd";
                }
            }


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered