More in this section

SitePanelBar

4 posts, 0 answered
  1. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    08 May 2009
    Link to this post
    Hi,
    I have a sitepanelbar like
    Senior Leadership Management
       CheifExecutive-Jonathan
       President-chuckmeclendon

    senior leadership management is a parent node for the CheifExecutive-Jonathan,President-chuckmeclendon.
    my requirement is
    1)seperate the designation(cheifexecutive) with the name(jonathan)
    and make the CheifExecutive-Jonathan to

    CheifExecutive
    Jonathan. with both having different color.

    For this i need to add the <br> tag between the designation and name and wrap the Name(jonathan) into a <span> tag so that i can apply different syling tto both the name and designation.

    The problem is how to get the child elements of a particular node and applying the tags as mentioned above.

    Thanks.
    Radha.
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    12 May 2009
    Link to this post
    Hi Subodh,

    I think you can do all this on the item_databound event:
        public void RadPanelbar1_ItemDataBound(object sender, RadPanelBarEventArgs e) 
        { 
            ... 
            if (e.Item.Level > 2) 
            { 
                //or something else 
                e.Item.CssClass = "MyClass"
            } 
            if (e.Item.Text=="CheifExecutive-Jonathan"
                e.Item.Text="CheifExecutive<br />Jonathan"
     
        } 

    The same way you can surround any text in the e.Item.Name with any html tag.

    Let me know if you need any further assistance.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    26 May 2009
    Link to this post
    Hi,
    and sorry for replying late.
    what you advised will work fine for the existing employee list.
    the code which you sent is like  hard-coded , what if in future he adds another employee to the list then the change will not be reflected to the new added employee.

    Thanks,
    Subodh
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 May 2009
    Link to this post
    Hello subodh,

    It is a sample code that illustrates how your requirement can be covered. You can use other properties of the panelbar item to identify the employees you are looking for.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered