Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridCommands.BestFitColumns Property

Adjusts the width of columns so that columns fit their contents in an optimal way.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public static RoutedCommand BestFitColumns { get; }

#Property Value

Type Description
RoutedCommand

A RoutedCommand object that defines a command implementing the ICommand, and is routed through the element tree.

#Remarks

<Button Command="dxg:GridCommands.BestFitColumns"
        CommandTarget="{Binding Path=View, ElementName=grid}">Best Fit (all columns)</Button>

Corresponding Method: TableView.BestFitColumns.

See Also