treeview web control

S

Sohail

Has anyone else had this problem?

Here is the XML that I am using as the source for the
treeview:

<TREENODES>
<TREENODE TEXT="ZZ_TEST">
<TREENODE TEXT="EndDate"/>
<TREENODE TEXT="SiteID"/>
<TREENODE TEXT="StartDate"/>
<TREENODE TEXT="TagName"/></TREENODE>
</TREENODES>

For some reason, I do not get the "text" attribute that is
supposed to go into the html (for client side scripting).
here is what I get as the html:

<tvns:treenode>
ZZ_TEST
<tvns:treenode>
EndDate
</tvns:treenode>
<tvns:treenode>
SiteID
</tvns:treenode>
<tvns:treenode>
StartDate
</tvns:treenode>
<tvns:treenode>
TagName
</tvns:treenode>
</tvns:treenode>

Is there any way that I can access these elements? How can
I fix it so that I have a text attribute for each treenode?

Thanks

Sohail
 
J

Juan Wajnerman

You cannot. Look at the source code, in treenode.cs
at line 738:

if (Text != String.Empty)
output.Write(Text);

The text of the node is written as a text node, not as
attribute.

To get the text value for a node in scripting, you should
use getAttribute method on a TreeNode. For example, this
line obtains the text of the selected node:

Treeview1.getTreeNode
(Treeview1.selectedNodeIndex).getAttribute("text")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,614
Members
45,292
Latest member
EttaCasill

Latest Threads

Top