My WPF datagrid's columns are fixed width, which means long text in the rows are cut off. How can I have the text wrap?
+2
A:
You can replace the cell with a Textblock with Textwrapping enabled. i.e.
<dg:DataGridTemplateColumn Header="Description" Width="*">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}" TextWrapping="WrapWithOverflow"/>
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
Asif
2009-12-24 22:29:36
How can I then edit the cell text?
Marcel
2010-01-19 13:49:03
Textblock is read only. you should use TextBox.
Nasit
2010-05-31 12:50:37