A newer version of this page is available. Switch to the current version.

How to: Bind a Control to Data in an XML File

This example demonstrates a way of binding a data-aware control (XtraGrid, XtraPivotGrid, XtraVerticalGrid, etc.) to data stored in an XML file. Note that specific controls may need additional customization after the control is bound to a data source. For more information refer to documentation of the corresponding control.

The code sample below binds a GridControl to XML data stored in an XML file.

// Create a DataSet and fill it with data from an XML file.
DataSet xmlDataSet = new DataSet();

// Bind the grid to the DataSet.
gridControl1.DataSource = xmlDataSet.Tables[0];