Well, it used to work, at least on version 2012.3 (I've verified it)
However, if you do the same on 2016.2, then it doesn't work. The cell is left in some kind of edit mode, while the keyboard cursor is not blinking.
This is frustrating, since after updating to the new version, I'm wasting more time on fixing stuff that used to work than writing new features, and I'm sure that I'll find more issues in the future.
Is there something that can be configured in order to make it work like it used to? I already tried ActionOnLostFocus="CommitEdit"
Why was this feature removed? It seems only logical to exit edit mode when clicking anywhere outside the edited cell.
7 Answers, 1 is accepted
Hi, the clicked area is actually the blank area in the grid. i've debuged the correct with both 2012 and 2016 sources, and i can make a patch that will make it work like it used to, but i don't understand why the code was changed. The 2016 code checks is the focus is within the gridview, and in that case, doesn't commit the changes.
Indeed, we will commit the edit operation if RadGridView loses focus. In your scenario, when you are clicking in the blank area, the focus stays in the grid. We are using the ActionOnLostFocus and its default value is CommitEdit. However, I am not sure why the behaviour is different in the 2012 version. I suppose that this was a bug which was fixed in our recent version.
I tried to reproduce it with 2012.3.1017, but I was not able to. Which exactly is the version you are using?
It seems logical to commit edit when the cell loose focus. I'm going to write a code that will keep the old behavior.
I've checked it and it seems that this bug is reproducible with the 2012.3.1112 internal build. However, it was fixed for the next service pack - 2012.3.1129.
If you need assistance on keeping the old behaviour, do not hesitate to contact me again.
Well, this is the "fix" that I coded:
This solution seem to work. However, even if I make a behavior out of it, I still need to go over every RadGridView on the software, and apply that behavior (And there are currently 93 grids on a lot of different views).
I would like to avoid changing the source code of the grid, since I will then need to apply the change every time I update the source code from your website.
I was hoping to use RegisterClassHandler, but unfortunately PreparingCellForEdit is not an event that can be registered in that way.
Is there any other options?
You can try to implement an AttachedBehavior and set it through a style for RadGridView. It would be something similar to this one:
Let me know how this works for you.