Skip to main content

Data Field Anchor

  • 2 minutes to read

If you are going to use multiple data fields, the pivot grid offers a field named Data Field Anchor. This is a separate field to which data fields in your view are automatically linked. This field is handy if you need to reposition all the data fields at a time. Dragging the data field anchor to a specific location will move the data fields to that location.

Since it represents data fields, it can only be located in one of the two areas – either in the column header area or in the row header area.

When coding, you can specify its location through the pivot grid’s OptionsDataField.Area property. To display the data field anchor in the column header area, set the pivot grid’s OptionsDataField.Area property to dfaColumn. To position it in the row header area, set this property to dfaRow.

Again, the data field anchor appears in the above areas, only if more than one data field is visible. However, if you need to hide the data field anchor even if multiple data fields are visible, assign a value of dfaNone to the OptionsDataField.Area property.

The table below lists the main properties of the pivot grid which affect the data field anchor’s appearance and behavior.

Binding Settings

The DataBinding properties of the visible data fields.

Summary Type

The SummaryType properties of the visible data fields.

Visibility

The OptionsDataField.Area property.

Contents

The OptionsDataField.Caption property.

Cell Visibility

The DataVisibility property.

Position

The OptionsDataField.Area and OptionsDataField.AreaIndex properties.

Appearance

The Styles.FieldHeader property.

To dynamically customize style settings for the data field anchor, handle the pivot grid’s Styles.OnGetFieldHeaderStyle events.

Note

These style settings do not modify an element’s background if the pivot grid is painted using the Windows XP (native) or Office2003 style.

Behavior

The OptionsDataField.Moving property.

Context Menu

Refer to the Field Header Context Menu topic.

Hints

The OptionsBehavior.FieldHeaderHints property.

The pivot grid’s OnGetCellHint event.

HitTest Information

The HitTest.HitAtDataField property.

See Also