The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.

I'm trying to populate a RadPanelBar programmatically
from an XmlDataSource defined in my code (i.e. not from an actual
XML file), that copies nodes over from a SiteMapDataSource. I'm doing
this because my site is extremely large (tens of thousands of pages),
and we're getting major performance hits when trying to populate the
RadPanelBar straight from the site map. Here's the ASP.NET code:

My first question is: The RadPanelBar isn't loading the items
properly. It loads the item hierarchy, but the names of the items are
all "Panelbar" and "Item", rather than the actual page names. I tried to
fix this by setting the DataTextField and related values (commented out
above), but this gave me the error "Object of type
System.Web.UI.WebControls.XmlHierarchyData does not contain a property
with the name 'Text'" (same error for 'Url'). Is there something else
missing from my code to make the RadPanelBar/XmlDataSource binding work,
or is this just some undocumented RadPanelBar quirk?

My second question is: is this even a good idea? What I'm trying to
do is to optimize the RadPanelBar's performance by traversing the site
map and only binding those nodes that are absolutely necessary to bind.
When our website was smaller, this was never a problem, although we did
notice some slowness. Nowadays, when I try to load our previous panelbar
control onto a new template (we're using Sitefinity 3.7), it takes so
long that the page hits a timeout before it has time to load, and so I'm
not even able to save the modified template. Any suggestions as to whether what I'm trying to do here (manual
traversal of the site map via XML instead of relying on a
SiteMapDataSource to bind itself) would work, or whether I should try a
different approach?

You can also use new RadPanelItem and populate the controls hierarchically load on demand. When you click on a root item, you will call BuildDataSource and populate it only with rootitem.items. The same applies if you click on any other child item.

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

because root refers to the SiteMapNode objects contained in the SiteMapDataSource Provider, and SiteMapNode objects have Title properties. If you're referring to frTitle, that's just the name of an XmlNode; I'm not putting data into frTitle.Title, but frTitle.InnerText (since I'm using an XmlDataSource to populate the RadPanelBar). Maybe I'm misunderstanding what you're trying to say, though.

Also, I looked into the example URL you posted, but it didn't seem very helpful at all since it doesn't deal with XmlDataSource—the example only shows DataSets and IEnumerables.

You object is not SiteMapNode. It is XmlHierarchyData. According to the MSDN there is not Title property. You need a helper class to make the conversation.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

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? root? frTitle? flatmap? flatmapdoc? newchild? 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 root, 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:

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 RadPanelbar1.DataNavigateUrlField, 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.

Tools

Sitefinity Professional Services

Progress, Telerik, Sitefinity 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.