Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Mask Editors Overview
     [Expand]Formatting and Parsing Values
     [Expand]Editor Buttons Overview
     [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]Examples
   [Expand]Lookup Editors
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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

How would you rate this topic?​​​​​​​