This nearly drove me crazy.  I’ve been working with the Developer’s Express grid in Windows Presentation Framework (WPF), and have NEVER been able to find a way to center the data in the column.  Turns out, it’s rather easy, BUT, it requires using the control nesting that makes WPF powerful and frustrating.

To center the text in the column, the dxg:GridColumn needs to have an EditSettings tag added.  Inside of that tag, add an TextEditSettings tag and set the HorizontalContentAlignment to “Center”.  Voila!


<dxg:GridControl Name=”gcTest”>
<dxg:GridColumn Name=”GridColumn1″ FieldName=”TEST_ID” Header=”ID” Width=”100″ HorizontalHeaderContentAlignment=”Center” VisibleIndex=”0″>
<dxe:TextEditSettings HorizontalContentAlignment=”Center” />
<dxg:GridColumn Name=”GridColumn2″ FieldName=”DESCRIPTION” Header=”Description” Width=”100″ HorizontalHeaderContentAlignment=”Center” VisibleIndex=”1″>
<dxe:TextEditSettings HorizontalContentAlignment=”Center” />


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s