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

Forums / 3.x Pre-release forums (retired) / Panel Bar List-Style, color

Panel Bar List-Style, color

5 posts, 0 answered
  1. Ben Alexandra
    Ben Alexandra avatar
    215 posts
    Registered:
    15 Sep 2012
    04 Apr 2007
    Link to this post

    HI,
    We are using a Rad panel bar and need to be able to change the color of the disc in an unordered list when things are selected. Here's the current situation:

    http://new.weleda.com/medicine/medicine_faq.aspx

    Here is the Rad code:

    RadPanelItem panel = RadPanelbar1.FindItemByUrl( ResolveUrl( sCurrentURL));
    if (panel != null)
    {
    if (panel.Owner is RadPanelItem)
    {
    ((
    RadPanelItem)panel.Owner).Expanded = true;
    }
    panel.Expanded =
    true;
    panel.Selected =
    true;
    panel.ImageUrl =
    "~/images/template/dot.gif";
    panel.ImagePosition =
    RadPanelItemImagePosition.Left;
    }

    This is an example of what we need the Rad panel to do:


    <ul style="list-style-type: square; color: Maroon;">
    <li>test 1</li>
    <li style="list-style-type: disc; color: green;">test 2</li>
    <li>test 3</li>
    </
    ul>

    Thanks a lot
    Ben/ Trakkware, Inc

  2. Nikolay
    Nikolay avatar
    1 posts
    Registered:
    29 Nov 2016
    05 Apr 2007
    Link to this post
    Hello Ben,

    You can use the SelectedCssClass property to apply a css style to the selected panel items. Also, please check the "Controlling the visual appearance" section in the help files.

    Hope this helps.

    Regards,
    Nick
    the telerik team

    Instantly find answers to your questions at the new telerik Support Center
  3. Ben Alexandra
    Ben Alexandra avatar
    215 posts
    Registered:
    15 Sep 2012
    05 Apr 2007
    Link to this post
    Hi-
    thanks for the reply. I don't think that accomplishes what we need. We did use that control to apply a CSS style, and were able to, for example, apply a padding or border to the selected text in the panel bar. However, we could not get any list styling to occur, like applying list-style-type: disc; which we would like, so the disc can change color with the text when selected.

    we changed this (red):

                    panel.Expanded = true;
                    panel.Selected = true;
                    panel.SelectedCssClass = "TestClass";
                    //panel.ImageUrl = "~/images/template/dot_gray.gif";
                    panel.ImagePosition = RadPanelItemImagePosition.Left;

    and then in the style sheet created .TestClass {} with some style properties. Some styles worked, but not list-style-type.

    The problem seems to be that the new class is only applied to the link not the line item.

    this is the HTML that comes out:

    <li class="item first last">
         <a id="ctl00_RadPanelbar1_p3_p0" class="link TestClass" href="/medicine/anthroposophic_medicine/what_is_anthroposophic_medicine.aspx">
         <span class="text">What is Anthroposophic Medicine?</span>
         </a>
    </li>
  4. Rosi
    Rosi avatar
    1 posts
    Registered:
    06 Dec 2016
    06 Apr 2007
    Link to this post
    Hi Ben,

    Thanks for your time and cooperation.

    The SelectedCssClass is applied on the link . I suggest you wrap the text of the item with ul tags. Please see the attached project for more details.

    Regards,
    Rosi
    the telerik team

    Instantly find answers to your questions at the new telerik Support Center
  5. Ben Alexandra
    Ben Alexandra avatar
    215 posts
    Registered:
    15 Sep 2012
    27 Apr 2007
    Link to this post
    Thanks, Rosi.  That worked really well.  Good idea making the selected item a list in code!

    Ben
Register for webinar
5 posts, 0 answered