1
votes

I have xamdatagrid in which I Add Item, every time new item added it goes to the bottom. I want every time I add item it should be on the top row "like reverse sort" also in field layout setting I am adding new record on top.

note: I removed sort option from field Note: I dont want to sort by any field except by row insertion order if its in xamdatagrid. or sort of list like list.reverse possibility in xamdatagrid.

1

1 Answers

0
votes

Assuming you're binding your grid to an ObservableCollection, use the Insert(0, item) method.

You can also use a CollectionViewSource for your grid's data source and set the sort there, while calling Add(item) on your source collection normally.