Change Theme Settings
Change Theme Settings
Themes
 
Metropolis
Moderno
iOS
Material
Material Compact
Office 365
Mulberry
Show All Themes
v
...v

Data Binding to XML

v


This demo illustrates how the BindToXML method can be used to easily populate the DevExpress MVC Navigation Bar with group and item information taken from an xml file. The xml file has the following structure:

<Cameras>
    <Brand Text="...">
        <Camera Model="..." Pixels="..." NavigateUrl="..." ImageUrl="..." />
        ...
    </Brand>
    ...
</Cameras>

The MVC NavBar is able to automatically retrieve group and item information by binding to data fields whose names coincide with property names of a group and item objects (such as the Text, NavigateUrl, ImageUrl and ToolTip). In this demo, the group text, and both the navigation location and image path of items are obtained automatically from the corresponding attributes of data source nodes. The texts used for individual items are composed dynamically by concatenating the values of the Model and Pixels attributes. This processing is performed within a delegate of the ItemDataBound method, which allows you to manipulate values being assigned to the properties of a NavBar item during data binding.