Search code examples
c#asp.nettelerikbreadcrumbs

telerik radsitemap not displaying child nodes


The code is below with the dataTable I am binding to. I can't figure out why it is only displaying the top node.

enter image description here

                BreadCrumbSiteMap.DataSource = siteMapNavigationLocation;
            BreadCrumbSiteMap.DataBind();
<telerik:RadSiteMap ID="BreadCrumbSiteMap" EnableViewState="true" runat="server"
                                                    DataFieldID="NodeID" DataFieldParentID="ParentNodeid" DataNavigateUrlField="url" DataTextField="NodeName"
                                                    OnNodeDataBound="RadSiteMap1_NodeDataBound"              >
                                    <DefaultLevelSettings ListLayout-RepeatDirection="Horizontal" SeparatorText="/" Layout="Flow" />
                                </telerik:RadSiteMap>

--EDIT-- If I add this to the markup it I can see 2 nodes. But it switches to vertical and does not show the other nodes.

 <LevelSettings>
                                        <telerik:SiteMapLevelSetting Level="0" MaximumNodes="4">
                                        </telerik:SiteMapLevelSetting>
                                    </LevelSettings>

Using this code in the databind I can see that every nod is bound and has a descending hierarchy. 0,1,2,3

     protected void RadSiteMap1_NodeDataBound(object sender, RadSiteMapNodeEventArgs e)
        {
            DataRowView nodeData = e.Node.DataItem as DataRowView;
            e.Node.ToolTip = nodeData["NodeName"].ToString();
}

Solution

  • Layout="Flow" stops all nodes below from rendering... I had to remove the parent node id so it wasn't hierarchical. Now it looks like the bread crumbs list i wanted..

    DataFieldParentID="ParentNodeid"
    

    https://docs.telerik.com/devtools/aspnet-ajax/controls/sitemap/functionality/layout