How to set text trim DataGrid DataGridTextColumn?

I am looking for examples to build text trim for a DataGridTextColumn.

In my current DataGridTextColumn, the text automatically ends and the row width increases. I want to add text trim for this.

+4
source share
1 answer

You can do it:

<DataGridTextColumn>
    <DataGridTextColumn.ElementStyle>
        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
            <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
        </Style>
    </DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
+6
source

All Articles