I have tried mulitple ways to load the treeview and I cannot find one way that works.
For instance I have tried using this:
RadTreeView1.LoadXml(GetTransformedXmlDoc("TreeViewCombined2.xsl", args)); |
Where GetTransformedXmlDoc() returns a correct xml document as a string. All it does is give me XML errors and shows me a node that doesn't even exist in the xml string. This is what it tells me: "There is an error in XML document (1, 40)." When I check for the specific error message this is what I get: "<Nodes xmlns=''> was not expected."
Where that node comes from I have no idea. It's not in the xml I am looking at.
I have tried:
RadTreeView1.DataSource = GetTransformedXmlDoc("TreeViewCombined2.xsl", args); |
RadTreeView1.DataBind(); |
Where GetTransformedXmlDoc() returns an XmlDataSource object. This sort of worked except I couldn't keep the root node from appearing in the treeview and it also screwed up the text properties of the nodes. Below is a sample xml doc in the exact same form as the one I am trying to load. I cannot set the DataTextField="Text" or the TextField="Text" because my root node doesn't contain that attribute. Is there a way around this?
<Nodes> |
<TreeViewNode ID="1" Text="Node 1" /> |
<TreeViewNode ID="2" Text="Node 2" /> |
<TreeViewNode ID="3" Text="Node 3" /> |
<TreeViewNode ID="4" Text="Node 4"> |
<TreeViewNode ID="5" Text="Node 5" /> |
</TreeViewNode> |
<TreeViewNode ID="6" Text="Node 6" /> |
</Nodes> |
I would appreciate any help as I have wasted the better part of 2 days trying to get this thing to load correctly.