I\'m using a WPF4.0 DataGrid. When double clicking on a cell in a new row everything works fine unless I\'ve added a cell style to that column. For example, I h
I just had a similar problem and found another solution by overwriting the Style for the DataGridCell in Blend.
The changed items from the original style are the setters for VerticalAlignment
and VerticalContentAlignment
in the Style itself to stretch the cell itself and VerticalAlignment="Center"
and HorizontalAlignment="Right"
in the Template property to align the content. Change these values to whatever you need to align the cells content.
The rest of the style could be removed so that the settings from the base style will be used (using the StaticResource the style is BasedOn). However I left the style as Blend produced it.
This resulting XAML-Code should then be included into the controls resources: