I'm using a XamDataGrid and doing some drag-drop operations.
I need to drop the selected items in the order they appear in the source grid.
It appears that .SelectedItems is in the order they're selected, not the visible order.
Is there a clean way to either get them in the order they're visible, or to re-order them so they match their visible order?
Thanks
HI,
Please let me know if you need further assistance regarding this issue.
HI Jweimann,
You could sort the selected records by index.
I am attaching a sample that does that.
Decided to do this unless someone has a cleaner solution:
private List<DataRecord> DraggedRowsReorderedByVisibleOrder(SelectedRecordCollection selectedRecords) { List<DataRecord> reorderedList = new List<DataRecord>(); foreach (var record in exampleUltraGrid.Records) { if (record.GetType() != typeof(DataRecord)) continue; if (selectedRecords.Contains(record)) reorderedList.Add((DataRecord)record); } return reorderedList; }