How can I align the column data to center in a WPF DataGrid?
DataGrid
If you are using DataGridTextColumn you can use the following code snippet:
<Style TargetType="DataGridCell"> <Style.Setters> <Setter Property="TextBlock.TextAlignment" Value="Center" /> </Style.Setters> </Style>
2.1m questions
2.1m answers
60 comments
56.9k users