In a behavior on RadGridView I'm subscribing to KeyDownEvent, and when I press Enter, I execute the following code:
I wanted to check what happens if I hit Enter without selecting any cell in the grid.
So first, I click outside the grid, this selects the first cell of the grid in an "unfocused" style:
Then, I hit Enter a first time: my code hits the first condition (AssociatedObject.SelectedCells.Count == 0) and does the early-return.
It also selects the next cell in the column:
I hit Enter a second time: my code hits the second condition (the one underlined in red), and throws an ArgumentException:
From what I understand, this is raised from CellInfoCollection.Contains, so from code I cannot debug since it's a Telerik dll.
Do you have more info on this? What am I doing wrong?