Show theme settings Shopping cart Download trialFree Trial
Change Theme Settings
Change Theme Settings
Themes
 
Show All Themes
v
...v

Data Binding to XML



This demo illustrates how the BindToXML method can be used to populate the DevExpress MVC TreeView with node information taken from an xml file. The source XML file contains hierarchical information about a set of classes and their members (properties, methods, events).

The MVC TreeView ships with the following data binding methods:

TreeView implements specific properties that point to the data fields containing necessary data. These are the TextField, ImageUrlField, NavigateUrlField, NameField and ToolTipField properties. If these properties are not defined, the TreeView is able to automatically bind to data fields whose names coincide with property names of a MVCxTreeViewNode object (such as the Text, ImageUrl, NavigateUrl, Name and ToolTip).

In this demo, the TextField, ImageUrlField, and NavigateUrlField properties are used to specify the names of data item attributes from which corresponding node settings are obtained. The NodeDataBound property is used to define a delegated method, changing the text style of nodes which represent classes (text is displayed in bold).

Collapse/Expand
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
The source code files for this demo are installed (by default) in the following directory:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxNavigationAndLayoutDemos