WPF DataGrid horizontal scrollbar not showing

后端 未结 7 1921
眼角桃花
眼角桃花 2021-02-05 08:14

I have created simple DataGrid with 4 columns, which go outside the bounds of DataGrid, and horizontal scrollbar is not showing. I tried setting width to each column but nothing

7条回答
  •  感情败类
    2021-02-05 08:26

    Obviously you need horizontal scroll bar.

    Two things need to do:

    1. Add property IsReadOnly="True" to your DataGrid

    2. Add MaxWidth="1200" VerticalScrollBarVisibility="Auto" to your ScrollViewer

    MaxWidth need to be set, you can change 1200 to any other value as you need.

    
        
    
        
    
    

提交回复
热议问题