I have a datagrid like this:
<DataGrid
ItemsSource="{Binding Things}"
AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Whatever" Binding="{Binding Blah}" />
</DataGrid.Columns>
</DataGrid>
Things and things look like this:
public ObservableCollection<Thing> Things { get; set; }
.
public class Thing
{
public string Blah { get; set; }
public Thing() { }
}
The default behavior for a datagrid is to start with a new empty line at the bottom. When I start editing any property of this line, a new thing is created and added to the Things collection. However, a new empty row is not displayed until I finish editing (i.e. press the enter button or select a new row / column). Is there a way (preferably one that does not violate MVVM) to make this new empty line right after editing starts?
This is the starting point:

This is after double-clicking an empty line and editing:

When I finish editing, a new empty line will appear:

But here is what I want (New blank line when editing):
