Print Page | Close Window

Property Grid Validation Design?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12637
Printed Date: 28 May 2024 at 9:10pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Property Grid Validation Design?
Posted By: MacW
Subject: Property Grid Validation Design?
Date 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.




Replies:
Posted By: Oleg
Date 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


Posted By: MacW
Date 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...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net