XmlMappedRange Control

The XmlMappedRange control is a range that is created only when a non-repeating schema element is mapped onto a cell in Microsoft Office Excel. For example, when the maxOccurs attribute of a schema element equals 1. After Visual Studio creates the XML mapped range, you can program against it directly without having to traverse the Excel object model. You can only delete a XmlMappedRange control within Excel when the element mapping is removed.

Applies to: The information in this topic applies to document-level projects for Excel 2013 and Excel 2010. For more information, see Features Available by Office Application and Project Type.

link to video For a related video demonstration, see How Do I: Use XML Mapping in Excel?.

Binding Data to the Control

An XmlMappedRange control supports binding to a single data field (simple data binding). The ListObject control can supports complex data binding, and is automatically created when a repeating schema element is mapped onto a cell. For more information, see ListObject Control.

The XmlMappedRange control are bound to a data source using the DataBindings property. When an XmlMappedRange is added to a worksheet cell, Visual Studio automatically generates a data set from the data in the mapped cells, and binds the control to that data set. The default data binding property of the XmlMappedRange is Value2.

If the data in the bound data set is updated through any mechanism, the XmlMappedRange control reflects the changes.

Formatting

You can apply the same formatting to an Microsoft.Office.Tools.Excel.XmlMappedRange control that you can apply to a Microsoft.Office.Interop.Excel.Range. This includes borders, fonts, number format, and styles.

Events

The events available for the XmlMappedRange control are:

See Also

Tasks

How to: Add XMLMappedRange Controls to Worksheets

How to: Map Schemas to Worksheets Inside Visual Studio

Concepts

Automating Excel by Using Extended Objects

Programmatic Limitations of Host Items and Host Controls

Other Resources

Binding Data to Controls in Office Solutions