![auto fit columns using the autofitstyle property in ultragrid](Images/WinGrid_AutoFitStyle_Extend_Last_Column_01.png)
You can specify that the WinGrid™ automatically resizes the last column in each band in order to occupy all of the available horizontal space. You can do this by setting the AutoFitStyle property on the DisplayLayout to 'ExtendLastColumn'.
For more information on auto-fitting columns, see Auto-Sizing Columns and Rows.
Right-click on the WinGrid and select UltraWinGrid Designer.
In the designer on the right select the option called "Control Settings". Scroll down and expand the DisplayLayout property, then scroll down to AutoFitStyle. The AutoFitStyle enumeration provides three options:
None - Automatic resizing is disabled. This is the default value of the property.
ResizeAllColumns - Resizes all of the columns so that they occupy all of the visible area.
ExtendLastColumn - Resizes the last column in a band so that it occupies all of the visible area that is not occupied by the other columns.
The ExtendLastColumn setting does not have any effect when at least one of the following conditions is true:
Card-view functionality is enabled.
Horizontal ViewStyle is being used.
There are multiple column scroll regions.
Below is a screen shot of a WinGrid whose AutoFitStyle property is set to 'None':
If the AutoFitStyle property were set to 'ExtendLastColumn', the WinGrid would look like this: