I want to move the add new record row at the bottom of the DataGrid to the top.
I found a code snippet about it:
internal static ObservableCollection<T> ToObservableCollectionNewRow<T>(this IEnumerable<T> source)
{
ObservableCollection<T> collection = new ObservableCollection<T>(source);
IEditableCollectionView view = CollectionViewSource.GetDefaultView(collection) as IEditableCollectionView;
view.NewItemPlaceholderPosition = NewItemPlaceholderPosition.AtBeginning;
return collection;
}
This code moved the new record adding line to the top, but the model started to be null in the RowEditEnding event.
I'm sorry for my bad english. Can you help me with this?