Change Theme Settings
Change Theme Settings
Material Compact
Office 365
Show All Themes

Data Binding to XML


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:

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

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.