Description
set TextBlock.TextAlignment to Right in DataGridTextColumn.ElementStyle will cause text overflow to right edge.
two thing can eliminate this:
-
drag move to change column width

-
when content longer than header

Reproduction Steps
Create a .net9.0-windows wpf project, and make a DataGrid like this:
<DataGrid>
<DataGrid.Columns>
<DataGridTextColumn Header="sss" Binding="{Binding}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Background" Value="CornflowerBlue"></Setter><!--for check-->
<Setter Property="TextAlignment" Value="Right"></Setter>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<DataGrid.Items>
<system:String>0</system:String>
</DataGrid.Items>
</DataGrid>
Expected behavior
Actual behavior
see description.
Regression?
I don't know
Known Workarounds
No response
Impact
No response
Configuration
.net9.0-windows wpf project
windows 10 22H2 x64 chinese lang
Other information
No response