Search code examples
wpfdatagridword-wrap

How get a WPF Datagrid with cells that wrap text instead of truncating it?


What must be done to get a WPF DataGrid with cells that wrap text instead of truncating it?

Right now when a text is bigger and don't fit in a column the text is truncated and users can't see it value cos the DataGrid's IsReadOnly property is true. What I want is that the text in cells be wrapped and the cell height (NO CELL WIDTH) increased the amount needed to show all the text.


Solution

  • You could try to template the cells with a TextBlock which has text-wrapping enabled.