SiteMap with SQLDataSource

Hi,
As a newbie I'm having trouble getting started with the site map control. Just as a working example for myself, I tried to setup an ultra simple breadcrumb but I failed so I need some help. My page looks like this:

When I run the page, I get this error: "This constraint cannot be enabled as not all values have corresponding parent values."
I've only got two nodes, they both have an entry for Parent Node so I can't tell what the problem is. Can you help?

Right well I read here that the root node ParentID must be NULL, so that's one problem sorted. The next two snags are:

1) Even though I had two entries in my SiteMap table, only one is displayed. I added a tooltip programmatically using the NodeDataBound event and found (using a break point) that both rows are read from the table.

2) The DataNavigatUrlField property is not picking up data from the "NodeURL" column in the table. I've set it programmatically OK in the NodeDatabound event.

As you can see, my second node is missing. I tried adding a third too but got the same result. However, if I remove 'Layout="Flow"' from the DefaultLevelSettings, then all my node items are displayed in a vertical menu.

Hristo Valyavicharski

All root items nodes must have "null" value for the ParentNodeNo. And the NavigateURL property must have this format - "http://www." for example: "http://www.telerik.com". Sample project is attached.

Regards,
Hristo Valyavicharski
Telerik

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

Hristo,
Thank you for your reply, that all makes sense. However, I don't believe that this addresses one of the problems I have, which is that I am only getting the first item in the SiteMap displayed.

I notice that the code you sent me has it the Layout property set to "List", When I change it to "Flow", it then only shows the first item on the site map. This problem more than the other two issues is completely crippling my ability to use this control. I want to use the control for a breadcrumb trail.

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.

Hristo,
Many thanks for your response. I did start with that demo but had difficulty untangling the menu control and the breadcrumb sitemap control. However, on your advice I went back to it, had another go and got it to work. I used the PageLoad event to call a routine that built the menu structure (from the database), which I then passed the DataBindBreadCrumbSiteMap routine. It works fine.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.