I still don't understand what you're trying to explain. I suspect we may be thinking about two different things. Allow me to ask for some clarification—which
object is XmlHierarchyData?
? I also don't understand how the "Title" property is relevant when I was trying to set DataTextField and DataNavigateUrlField to "Text" and "Url", and not "Title". "Title" is only used in referring to objects like
, a SiteMapNode, which clearly has a Title property, which I convert to a string to feed to an XmlNode's InnerText property.
By the way, after making some minor changes to my code, I'm now finding that it works, somewhat—although I don't see how the changes I've made may have fixed the problem. I'm seeing the correct names appearing on the PanelBar items now (i.e. "Testing Folder", etc). Here's the code that's changed since the above version:
XmlNode newchild = flatmapdoc.CreateNode(XmlNodeType.Element,
XmlNode ncTitle = flatmapdoc.CreateNode(XmlNodeType.Attribute,
ncTitle.InnerText = child.Title.ToString();
XmlNode ncURL = flatmapdoc.CreateNode(XmlNodeType.Attribute,
ncURL.InnerText = child.Url.ToString();
flatmap.Data = flatmapdoc.InnerXml;
RadPanelbar1.DataSource = flatmap;
//RadPanelbar1.DataNavigateUrlField = "NavigateUrl";
I don't know why it works now, but the above code works, except that it's not adding links to my PanelBar items. When I uncomment the line about
, it gives me the same error as before ("Object of type
System.Web.UI.WebControls.XmlHierarchyData does not contain a property
with the name 'NavigateUrl'").
Sorry for all these misunderstandings. I'm desperately trying to understand what's going wrong! If it would help, I can post both the .ascx and .ascx.cs files so that you can get the entire picture of what's going on in this control.