Partager via


TREENODETYPESRC Attribute | treeNodeTypeSrc Property

Sets or retrieves a value that indicates the URL to an XML file, String, or XML data island containing TREENODETYPE elements.

Syntax

HTML <namespace:TREEVIEW TREENODETYPESRC = sTreeNodeTypeSrc... >
Scripting TREEVIEW.treeNodeTypeSrc [ = sTreeNodeTypeSrc ]

Possible Values

namespace Prefix that associates a custom tag with an XML namespace. This prefix is set using the XMLNS attribute of the html tag.
sTreeNodeTypeSrc String that specifies or receives the URL to an XML file containing TREENODETYPE elements.

The property is read/write. The property has no default value.

Remarks

You can encapsulate and reuse node types in an XML data island. The XML file must contain only TREENODETYPE elements wrapped in opening and closing TREENODETYPES tags.

The content of the XML data island replaces all TREENODETYPE elements that are children of the TREEVIEW element.

The XML data island inherits the namespace of the databound element. The XML file must not contain any namespaces.

The XML data island must be syntactically well-formed XML.

After setting the value of this attribute, call the databindTypes method to render the changes.

Examples

The following example demonstrates how to set the TREENODETYPESRC attribute of the TREEVIEW element to an XML file called treenodetypes.xml.

<HTML XMLNS:mytree>
<?IMPORT NAMESPACE="mytree" IMPLEMENTATION="treeview.htc"/>

<BODY>
<H1>TreeNodeTypeSrc Sample</H1>

<mytree:TREEVIEW ID="oTree"
    DEFAULTSTYLE="font: 12pt verdana"
    SYSTEMIMAGESPATH="treeimages"
    CHILDTYPE="folder"
    TREENODETYPESRC="treenodetypes.xml"/>

</BODY>
</HTML>

Code example: https://samples.msdn.microsoft.com/workshop/samples/webcontrols/treeview/TreeNodeTypeSrc_XmlFile.htm

The following is the content of the XML file, treenodes.xml, used in the preceding example.

<TREENODETYPES><TREENODETYPE IMAGEURL="folder.gif"
EXPANDEDIMAGEURL="folderopen.gif"
EXPANDABLE="Always"
TYPE="MyTreeNodeType">
</TREENODETYPE>
</TREENODETYPES>

The TREENODESRC attribute of the TREEVIEW element can also be set to a String containing the TREENODE elements as shown in the following example.

<HTML XMLNS:mytree>
<?IMPORT NAMESPACE="mytree" IMPLEMENTATION="treeview.htc"/>

<BODY>

<mytree:TREEVIEW ID="tvw1" DEFAULTSTYLE="font: 12pt verdana"
SYSTEMIMAGESPATH="treeimages" CHILDTYPE="folder"
TREENODETYPESRC="<TREENODETYPES><TREENODETYPE IMAGEURL='images/folder.gif'
EXPANDEDIMAGEURL='images/folderopen.gif'
EXPANDABLE='Always'
TYPE='MyTreeNodeType'>
</TREENODETYPE>
</TREENODETYPES>" >
<mytree:TREENODE TYPE="MyTreeNodeType" TEXT="My Tree Node">
    </TREENODE>
    <mytree:TREENODE TYPE="MyTreeNodeType" TEXT="My Tree Node 2">
    </mytree:TREENODE>
</mytree:TREEVIEW>

</BODY>
</HTML>

Code example: https://samples.msdn.microsoft.com/workshop/samples/webcontrols/treeview/TreeNodeTypeSrc_String.htm

Applies To

TREEVIEW

See Also

Internet Explorer WebControls, About the TreeView WebControl