Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Property Grid Validation Design?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Property Grid Validation Design?

 Post Reply Post Reply
Author
Message
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: Property Grid Validation Design?
    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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2008 at 2:12am
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
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2008 at 9:39am
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...
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.