Property Grid Validation Design? |
Post Reply |
Author | |
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
Posted: 07 November 2008 at 9:39am |
Hi,
how is the validation in the PropertyGrid intented to be used? There seems to be only the GridIItem OnValidate method, which allows me to either accept or reject a change for a grid item. But there seems to be no way to display a message and also keep the editor "alive", allowing the user to correct his input. For example, my users type a complex (and long) formula into the grid value field. The OnValidateItem is fired. My method checks the formula and finds a problem. I now can either accept the invalid formula, or revert to the old content of the edit field - erasing everything the user has typed so far. This of course is not acceptable. This cannot be how this is designed to be used. All other grid controls on the market provide a way to ínform the user about a problem while keeping the editor active and the current contents set... I'm sure I'm jut not getting it. Or has Codejock just not thought that through or looked at other grid controls before implementing this? I have found quite a number of questions on similar issues, but no replies... And yes, I did check the CJ help. The only information I've found was the description "This method is called to check value from in-place edit control" for the OnValidateEdit method. Which is not really helpful. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You can catch standard XTP_PGN_ITEMVALUE_CHANGED message and if you don't like new value show message box set focus back.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Hi, Oleg
not sure what you have in mind. XTP_PGN_ITEMVALUE_CHANGED is sent _after_ the edit field has called the OnValidateItem method. At this time the value of the item is already set if the OnValidateItem method accepted the change, or contains the contents before the edit cycle began... |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |