I Have a DataGrid with its FlowDirection set to "RightToLeft". Problem is when displaying negative numbers, the minus sign is s开发者_开发知识库hown on the opposite side. Setting the FlowDirection of the cell itself to "LeftToRight" fixes it, but then the left border of the cell moves to the right, so I have no border on the left, and a double border on the right. How can I fix this?
You're gonna have to set FlowDirection on the TextBox rather than on the DataGridCell. If you're using a DataGridTextColumn then
<DataGridTextColumn ...>
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="FlowDirection" Value="LeftToRight" />
</Style>
</DataGridTextColumn.ElementStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="TextBox">
<Setter Property="FlowDirection" Value="LeftToRight" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
精彩评论