How to resize WPF DataGrid to fit its content?

前端 未结 5 1840
别那么骄傲
别那么骄傲 2020-12-28 14:47

The aim

I would like to set such size for the DataGrid (standard, from WPF) so all cells (text) would be fully visible. I have window with DockPanel, with DataGrid

5条回答
  •  北海茫月
    2020-12-28 15:33

    SizeToCells is what worked for me. I like this because its in XAML and it's concise.

    
    

提交回复
热议问题