Hello,
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?
Thanks!
I've fixed my issue by doing the following instead:
Please let me know if you have a better solution (one that would avoid having a comment explaining Telerik's internal behavior).
Thanks!
Should be in UI for WPF. Sorry!
Hello Dilyan,
I would have gladly checked for the Owner property on GridViewCellInfo instead of using a .Contains method, but unfortunately, it is private.
Actually, the internal booleans HasItemAndColumn or IsValid would have been perfect for my needs.
Anyway, I used .Contains because I didn't see any other way using the public API!
Thanks for your reply anyway!