Setting AutoDistributionGrid.FitCellsOfWidth to non Double.NaN value directs grid to automatically create as many columns of the width specified as the property value that can fully fit in the grid's width (but at least one). When grid width is being changed the number of columns is adjusted automatically.