Skip to end of metadata
Go to start of metadata

Besides the simple, easy binding, WebTreeView.NET® 1.0 is also equipped with a lot of properties you can set. This can be accessible if you add a node to the Selected data bindings box and select it. Please see the screenshot below:

Following is the list of available properties you can set:

DataDescription
DataMemberGet or set the Data Member.
DepthGets or set the Depth of the databinding.
DataBindingsDescription
AllowEditingFieldSets a node edit ability based on the XML.
CheckedFieldInitially check or uncheck node when ShowCheckBox property is set to true.
CheckedStateFieldInitially sets the checked state of a node when ShowCheckBox property is set to true.
EnabledFieldEnables or disables node based on the XML.
ExpandedFieldExpands or collapses node based on the XML.
ExpandedImageFieldSets the expanded node image icon based on the XML.
ImageFieldSets the collapsed node image icon based on the XML.
ImageToolTipFieldSets the tooltip image icon based on the XML.
MaxBindingDepthFieldSets the node level you want to bind based on the XML.
NavigateURLFieldSets the URL when a node is selected based on the XML.
SelectableFieldSpecifies if a node is selected or not based on the XML.
SelectedImageFieldSets the collapse icon image of the selected node based on the XML.
ShowCheckBoxFieldShows or hides check box based on the XML.
TagFieldGets or sets a string which contains data about the WebTreeViewNode.
TargetFieldSpecifies the target window when the node is clicked based on the XML.
TextFieldSets the text of a node that you want to display based on the XML.
ToolTipFieldSets the tooltip of a node based on the XML.
VisibleFieldSets the visibility of a node based on the XML.
Default PropertiesDescription
AllowEditiingSets a node edit ability.
CheckedCheck or uncheck a node.
CheckedStateSets the checked state of a node.
EnabledEnables or disables node.
ExpandedExpands or collapses node.
ExpandedImageSets the image icon of expanded node.
ImageSets the image icon of collapsed node.
ImageToolTipSets the tooltip image icon of a node.
MaxBindingDepthSets the node level you want to bind.
NavigateURLSets the URL when a node is selected.
SelectableSets a node's selected ability.
SelectedSpecifies if a node is selected or not.
SelectedExpandedImageSets the expand icon image of the selected node.
SelectedImageSets the collapse icon image of the selected node.
ShowCheckBoxShows or hides check box.
TagGets or sets a string which contains data about the WebTreeViewNode.
TargetSets the target window when a node is clicked.
TextSets the text of a node.
ToolTipSets the tooltip of a node.
ValueSets the value of a node.
VisibleSets the visibility of a node.

Notice that both Databindings properties and Default properties are identical. The difference between them is, you can set each property value under the Databindings based on the value specified on your XML. This approach is designed to provide you with a hassle-free data binding process. You only need to set the structure of your Treeview and its properties in your XML file.

A sample of XML file which can be bound to WebTreeView.NET® 1.0  

The Depth property allows you to controls which node level you want the properties to be applied. One thing you should note is that this only applicable to the same XML name. The default value for this property is -1 which means all properties will be applied to the same XML name. If you set the value to 0 (the index of a node), the properties will only be applied to all index 0 nodes.

There are some scenarios when you have two different node levels, but both nodes have the same DataMember and you need to set the different properties for each node level. This is the case when you need to change the Depth's value based on the node's index that you want to set to. Have a look at the image below and you will see that there are two different node levels, but same DataMember.

Products.xml

If you leave Depth to its default value, the Selectable properties will be applied to all nodes. You need to set the Depth to 1, if you want to apply the Selectable to "WebCombo.NET" node only. Set it to 2 if you want to apply the Selectable to "WebCombo.NET 2.0" node, "WebCombo.NET 3.0" node, and "WebCombo.NET 4.0" node.

MaxBindingDepth is a property which allows you to select how many child nodes you want to bind. This feature will be a great help when you have deep-structured XML and for example, you want to bind a parent node and the first level child node. WebTreeView provides you MaxBindingDepth property to achieve your scenario.

You only need to add a node to the Selected databindings box and set the MaxBindingDepth value to the desired child node level. Please note that the value of the MaxBindingDepth property is based on how many child node level you want to bind, so this is a relative value, not absolute value. For example, you have a deep-structured XML and you want to bind a parent node and level three child nodes only.

Notice that the grayed part will be the child nodes of Parent 2 node

Select the Parent node and add it to the Selected data bindigs box.
Set the MaxBindingDepth to 3

Run your project and it will look like the following screenshot.