2.2.5.1 Data Binding

The association between a particular cell in a recordset, specified by a row and a field, and a shape data item is called a data binding.

A cell in a recordset can be bound to zero or more shape data items. A cell can be bound to only one shape data item per shape. A shape data item can be bound to only one cell.

The cell bound to a shape data item is specified by the BindingID and Name attributes of the corresponding CT_ShapeData element in the ShapeInfo XML Part. The BindingID attribute references a CT_Binding element which specifies the row of the recordset. The Name attribute references a CT_DataColumn element which specifies the field of the recordset.

The CT_BindingConnection element that contains this CT_Binding element referenced by BindingID specifies the recordset that contains the cell bound to the shape data item.

When the data in a cell in a recordset changes, the shape data item that it is bound to is updated in the following manner:

  • The Value attribute of the CT_ShapeData is updated with the value of the data in the cell.  This could involve a data type conversion from the data type of the cell as specified by the Type attribute of its corresponding CT_DataColumn, to the data type of the shape data item as specified by the Type attribute of the bound CT_ShapeData element.

  • The FormattedValue attribute of the CT_ShapeData is updated with a string representation of the value of the data in the cell formatted for display.  The formatting of the value into a string is done using the following attributes of the CT_ShapeData element: Format, LangID, UnitLabel, CalendarID, CurrencyID, ServerAction, Unit and DisplayUnit.