Skip to content

DevExpress-Examples/wpf-data-grid-automatically-resize-grid-columns-based-on-their-content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Data Grid - Automatically Resize Grid Columns Based on Their Content

Set the column's Width property to Auto to make the GridControl automatically recalculate the optimal width for this column based on its visible content:

image

This example contains the following implicit style that applies the specified setting to all columns:

<Window.Resources>
    <Style TargetType="dxg:GridColumn">
        <Setter Property="Width" Value="Auto"/>
    </Style>
</Window.Resources>

Files to Review

Documentation

About

Calculate the optimal width for columns based on their visible content

Topics

Resources

License

Stars

Watchers

Forks