Resizes the headers and data cells that correspond to the current field to the minimum width required to completely display their contents.
This method can be applied to a data field or row field. It resizes the headers and data cells that correspond to the field so that their contents are completely displayed. The ApplyBestFit method takes into account:
the field’s display caption specified by the Caption property (for row fields only);
the values of the field;
summary values (totals) displayed within the columns that correspond to the current field (only for data fields).
End-users are able to adjust the width of a field’s headers and data cells in this manner by double-clicking the right edge of the corresponding column header or row header provided that the field’s Options.Sizing property is set to True. Note that this property has no effect when the ApplyBestFit method is called in code.
The ExpressPivotGrid also provides the ApplyBestFit method which can be used to adjust the widths of the headers and data cells for all the visible fields in the control. This method simply calls the ApplyBestFit method for each visible field.