Articles in this section
Category / Section

How to auto fit all the columns in a GridControl based on the Window size?

1 min read

GridControl provides support to automatically fit all the columns within in a view based on the Window size by using GridColumnSizer support. Also, when manually resize any column, it will automatically adjust the width of other columns to fit it within the view.


To achieve the above behavior, need to set the AllowAutoCalculateSize , ListenToSizeChanged and ColumnSizer properties in the Loaded event of GridControl like below.



private void Grid_Loaded(object sender, RoutedEventArgs e)
    grid.Model.Sizer.AllowAutoCalculateSize = true;
    grid.Model.Sizer.ListenToSizeChanged = true;
    grid.Model.Options.ColumnSizer = GridControlLengthUnitType.Star;


Sample Link:


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Please sign in to leave a comment