Back to Devexpress

PivotGridControl.BestFitArea Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridcontrol-bdfbb0be.md

latest5.7 KB
Original Source

PivotGridControl.BestFitArea Property

Gets or sets which interface elements are taken into account when calculating optimal width for columns.

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public FieldBestFitArea BestFitArea { get; set; }
vb
Public Property BestFitArea As FieldBestFitArea

Property Value

TypeDescription
FieldBestFitArea

A FieldBestFitArea enumeration value that specifies interface elements that are taken into account when calculating the optimal width for columns.

|

Available values:

NameDescription
None

The best-fit functionality is disabled.

| | FieldValue |

The contents of field values are taken into account when calculating the best-fit size.

| | FieldHeader |

The contents of field headers are taken into account when calculating the best-fit size.

| | Cell |

The contents of data cells are taken into account when calculating the best-fit size.

| | All |

The contents of data cells, field headers and field values are taken into account when calculating the best-fit size.

|

Remarks

To learn more, see Best Fit.

The following code snippets (auto-collected from DevExpress Examples) contain references to the BestFitArea property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-pivotgrid-how-to-display-underlying-data-asynchronously/CS/WpfDrillDownDataSourceExample/MainWindow.xaml.cs#L35

csharp
private void ThemedWindow_Loaded(object sender, RoutedEventArgs e) {
    pivotGridControl1.BestFitArea = DevExpress.Xpf.PivotGrid.FieldBestFitArea.FieldHeader;
    pivotGridControl1.BestFit();

wpf-pivotgrid-customize-the-cell-template/CS/HowToCustomizeCellTemplate/MainWindow.xaml.cs#L19

csharp
pivotGridControl1.DataSource = OrderSourceList;
pivotGridControl1.BestFitArea = DevExpress.Xpf.PivotGrid.FieldBestFitArea.FieldHeader;
pivotGridControl1.BestFit();

wpf-pivotgrid-customize-filter-drop-down/CS/WpfPivotCustomFilterDropDownExample/MainWindow.xaml.cs#L22

csharp
{
    pivotGridControl1.BestFitArea = DevExpress.Xpf.PivotGrid.FieldBestFitArea.FieldHeader;
    pivotGridControl1.BestFit();

wpf-pivotgrid-how-to-display-underlying-data/CS/WpfDrillDownDataSourceExample/MainWindow.xaml.cs#L37

csharp
{
    pivotGridControl1.BestFitArea = DevExpress.Xpf.PivotGrid.FieldBestFitArea.FieldHeader;
    pivotGridControl1.BestFit();

wpf-pivotgrid-customize-the-cell-template/VB/HowToCustomizeCellTemplate/MainWindow.xaml.vb#L20

vb
pivotGridControl1.DataSource = OrderSourceList
pivotGridControl1.BestFitArea = DevExpress.Xpf.PivotGrid.FieldBestFitArea.FieldHeader
pivotGridControl1.BestFit()

wpf-pivotgrid-customize-filter-drop-down/VB/WpfPivotCustomFilterDropDownExample/MainWindow.xaml.vb#L20

vb
Private Sub ThemedWindow_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
    pivotGridControl1.BestFitArea = DevExpress.Xpf.PivotGrid.FieldBestFitArea.FieldHeader
    pivotGridControl1.BestFit()

See Also

BestFit

PivotGridControl Class

PivotGridControl Members

DevExpress.Xpf.PivotGrid Namespace