[Expand]General Information
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Collapse]Editors and Simple Controls
   [Collapse]Simple Editors
    [Expand]Included Components
    [Expand]Editors Structure
    [Collapse]Editors Features
      Text Editing Overview
     [Expand]Input Mask
     [Expand]Format and Parse Editor Values
     [Expand]Editor Buttons
     [Expand]Dropdown Editors Overview
      Image Editing Menu
     [Collapse]Data Binding Overview
       Binding to Regular ADO.NET Sources
       Binding to XML Data
       Binding to Data Created at Runtime
     [Expand]Appearance Customization
     [Expand]Miscellaneous Features
    [Expand]Member Tables
   [Expand]Lookup Editors
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
    Templated ListBox Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Binding to XML Data

The DataSet component allows binding editors to XML data. This topic explains how to do this and provides an example. Please refer to the Data Binding Overview topic for other data binding methods available.

Expanded Binding to XML Data

To bind an editor to XML data, you need to create a DataSet object. This object provides methods allowing you to load XML files, streams containing XML data, etc. Once data is loaded into the DataSet, you can bind an editor to a data field using the editor's DataBindings property.

The image below illustrates binding to XML data.

When an editor is bound to XML data, changing the editor's value does not update the data source. Data changes are actually applied to the DataSet where the data was loaded. To apply changes to the data source, use the methods provided by the DataSet class. For instance, if data has been loaded from an XML file using the ReadXML method, you need to call the WriteXML method to overwrite that file.

Note that binding to XML data can only be done at runtime.

Expanded Example - Binding an Editor to an XML File

The sample code below binds a text editor control to XML data stored in a file. The editor is bound to a field using the DataBindings property and its Add method. This method requires three arguments: the name of the property to be bound, the data table (data view) containing the desired data and the field name.


Expanded See Also

Is this topic helpful?​​​​​​​