Freigeben über


XmlMappedRange control

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

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. For more information, see Features available by Office application and project type.

Bind 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 is 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 XmlMappedRange control that you can apply to a Range. This includes borders, fonts, number format, and styles.

Events

The events available for the XmlMappedRange control are:

See also