The best place to see about this problem is
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c71fe21a-6549-4dcf-aee9-43d02e73194f[
^]. Here is some of the code from my solution:
<datagrid>
<datagrid.resources>
<style x:key="TextBlockRightAlignStyle" xmlns:x="#unknown">
TargetType="{x:Type TextBlock}">
<setter property="TextAlignment">
Value="Right" />
<setter property="Padding">
Value="5,0" />
<setter property="VerticalAlignment">
Value="Center" />
</setter></setter></setter></style>
<style x:key="TextBoxRightAlignStyle" xmlns:x="#unknown">
TargetType="{x:Type TextBox}">
<setter property="TextAlignment">
Value="Right" />
<setter property="Background">
Value="Transparent" />
<setter property="Padding">
Value="5,0" />
<setter property="VerticalAlignment">
Value="Center" />
</setter></setter></setter></setter></style>
</datagrid.resources>
<datagrid.columns>
<datagridtextcolumn header="Amount">
Binding="{Binding Amount, StringFormat={}{0:#\,###},
UpdateSourceTrigger=LostFocus}"
ElementStyle="{StaticResource TextBlockRightAlignStyle}"
EditingElementStyle="{StaticResource TextBoxRightAlignStyle}"
Width="130" />
</datagridtextcolumn></datagrid.columns>
</datagrid>
I included the alignment stuff since somebody may find it useful.