0
votes

I'm using SelectionMode as Extended (multi select) with WPF DataGrid. The SelectedIndex value always returns the first row that was selected, irrespective of the selection direction.

For example, if I start at index 0 and end at 4, I can work with it fine. But if I start from 4 and go to 0, SelectedIndex returns 4 and I don't have a clue to add the number of selected cells or subtract.

Is there a way to find the selection direction?

1

1 Answers

1
votes

The best way to know which items in a Datagrid are selected when using multiselection is to iterate through the SelectedItems property.