I have a Grid with many columns.
On small pc screens, the columns are automatically resized. Instead of this default behavior, I want an horizontal scrollbar (and the columns not to be resized).
If I set the MinWidth property on each columns, I have the scrollbar but I can't resize the columns anymore (not enough room). I also couldn't succeed with ScrollViewer (and it hurt the performances).
How can I get the scrollbar AND be able to resize the columns ?
<Grid>
<DataGrid Height="200" Width="200" HorizontalScrollBarVisibility="Visible">
<DataGrid.Columns>
<DataGridTextColumn Header="Column 1" Binding=.../>
<DataGridTextColumn Header="Column 2" Binding=.../>
<DataGridTextColumn Header="Column 3" Binding=.../>
<DataGridTextColumn Header="Column 4" Binding=.../>
[...]
</DataGrid.Columns>
</DataGrid>
</Grid>
I tried your code and I get both the scroll bar for the grid when data doesn't fit, each column auto fits to the largest text size, and the columns are resizeable.