Prashant Prashant - 1 year ago 268
C# Question

Text alignment in a WPF DataGrid

How can I align the column data to center in a WPF


Answer Source

It's hard to say without knowing specifics, but here's a DataGridTextColumn that is centered:

<wpf:DataGridTextColumn Header="Name" Binding="{Binding Name}" IsReadOnly="True">
            <Setter Property="FrameworkElement.HorizontalAlignment" Value="Center"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download