09-17-2024 10:36 AM
If you have the "Edit Cell?" event of a Tree Control in an Event Structure, when validating a cell edit, the cell text often flickers to the previous value.
This seems to only appear when validating by clicking somewhere else on the tree, but not when clicking outside of the tree:
The code is as simple as this (no hidden case):
This may be a detail, but this is frustrating for the user and does not look professional.
Is there a way around this?
Regards,
Raphaël.
09-17-2024 11:41 AM - edited 09-17-2024 11:47 AM
I also see the same flicker in 2018 but it goes away when I use the standard Edit Cell event, not the filter event. I don't know the exact series of events that occur when you click off a control but essentially, the value doesn't get updated to the control immediately as it does when you click enter. Clicking outside the control causes the control to lose focus first. Then it reverts back to previous value (possibly while the filter event is executing) because it doesn't realize that the value has been changed yet. Then the filter event occurs, followed by the actual edit cell event.
Again, this is a guess on my part (hopefully a somewhat educated guess). 😜
09-18-2024 05:15 PM
The code below seems/looks like/is Rube-Goldberg, but it seems to get rid of the flicker, at least in 2021. I will need to try with other versions.
Let me know if the snippet below doesn't work for you and you need 2020 version. 2021 version attached. The false case is empty, just the boolean wired through.
If discard is false, then no flicker when mouse clicking empty spot in tree, if true then flickers back to original value, assume the latter is okay.
09-19-2024 11:22 AM
A little cleaner and less Rube. The True Case is empty, just boolean wired through.
PS Thanks for bringing up this topic, just noticed it in one of my programs.