Reputation: 261
I'm looking for examples for building a text-trimming for DataGridTextColumn.
In my current DataGridTextColumn, the text is automatically wrapped and the row width grows. I want to add for that text-trimming.
Upvotes: 7
Views: 4329
Reputation: 4116
You can do this:
<DataGridTextColumn>
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
Upvotes: 19