RadSiteMap Does not show parent node and lines

2 posts, 0 answers
  1. Ronak
    Ronak avatar
    108 posts
    Member since:
    Sep 2010

    Posted 28 Oct 2010 Link to this post

    Hi there
    i am using radsitemap in listview and then bind radsitemap to Listview well it works fine but it doesnt show parent node and therefore nodelines.please refer code below
                             <li class="staff-item">
                                 <div class="photo-container">
                                      <a href='<%# DataBinder.Eval(Container.DataItem,"PageUrl") %>' >
                                         <img src='<%# DataBinder.Eval(Container.DataItem,"Photo") %>' alt="" height="110" width="90"/>
                                 <div class="data-container">
                                            <a href='<%# DataBinder.Eval(Container.DataItem,"PageUrl") %>'>
                                                <%# DataBinder.Eval(Container.DataItem, "Name")%>
                                         <li><%# DataBinder.Eval(Container.DataItem, "PrimaryTitle")%></li>
                                          <!-- <%# DataBinder.Eval(Container.DataItem, "Area")%> -->
                                            <Telerik:RadSiteMap ID="radSiteMap" DataSource='<%#DataBinder.Eval(Container.DataItem, "Areas") %>'  DataFieldID="ID" DataFieldParentID="ParentID"
                                                              DataTextField="AreaText" ShowNodeLines="true" runat="server" >
    public class FacultyStaff {
           public string ID { get; set; }
           public string Name { get; set; }
           public string Photo { get; set; }
           public string PrimaryTitle { get; set; }
           public string PageUrl { get; set; }
           public List<FacultyArea> Areas { get; set; }
           public string Area { get; set; }
       public class FacultyArea {
           public string ID { get; set; }
           public string AreaText { get; set; }
           public string ParentID { get; set; }
    if (item["AreaDirectory"] != null)  {
                      /*Code to get only first area of Speciality
                      string[] Areas = item["AreaDirectory"].ToString().Split(new char[] { ';' });
                      string[] Area = Areas[0].Split(new char[] { '|' });
                      faculty.Area = Area[0]; */
                      /*Code To Display all areas in Telerik SiteMap Control */
                      List<FacultyArea> facultyareas = new List<FacultyArea>();
                      TaxonomyFieldValueCollection areas = (TaxonomyFieldValueCollection)item["AreaDirectory"];
                      foreach (TaxonomyFieldValue area in areas) {
                          FacultyArea facultyarea = new FacultyArea();
                          facultyarea.AreaText = area.Label;
                          facultyarea.ID = area.TermGuid;
                          facultyarea.ParentID = "46355449-ACD0-412C-A80F-9C91872B2EA0";
                      FacultyArea parentAreas = new FacultyArea() { ID = "46355449-ACD0-412C-A80F-9C91872B2EA0", ParentID = "D59B0E15-8207-439F-8034-841887AF53D8", AreaText = "Special Areas" };
                      faculty.Areas = facultyareas;

    Please advise me
  2. Yana
    Yana avatar
    4547 posts

    Posted 03 Nov 2010 Link to this post

    Hi Ronak,

    Please check again our help article about databinding of RadSiteMap here - note that ParentID should be set to null in order to have parent node.

    Hope this helps.

    Kind regards,
    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
  3. DevCraft R3 2016 release webinar banner
Back to Top