Print Page | Close Window

Validating input - CXTPPropertyGridItem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=3032
Printed Date: 21 November 2024 at 10:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Validating input - CXTPPropertyGridItem
Posted By: Kevin6
Subject: Validating input - CXTPPropertyGridItem
Date Posted: 14 October 2005 at 9:25am

I am trying to validate a value in a CXTPPropertyGridItem. The handler OnValidateEdit  seems a reasonable place to start.

I validate the data and find a problem. I alert the user - however the PropertyGrid has moved the selected item to the next one in the PropertyGrid list....

This is not the behaviour I want - as in some cases its imperitive that I have a value in the list...

I have got close - by calling CListBox::SetCurSel - but because I cannot set m_pSelected in CXTPPropertyGridView class - any subsequent selections are out of synchronisation for one click.... and cause the validation routine to fail....

Could you please suggest to me a method by which I may move the selected item - BACK in the PropertyGridView to the problem item?????

regards

Richard



-------------
Kevin.



Replies:
Posted By: Kevin6
Date Posted: 17 October 2005 at 2:37am

With repsect to the problem above - it seems to me that Validate is incorrectly specified. Currently it is declared as -:

virtual void Validate(void);

when I beleive it should really be

virtual bool Validate(void);

Where the default implementation always returns true. How when the user derives and implements this method should they return 'false' then the cursor does not move to the next item in the grid.

Anythoughts on the initial post?



-------------
Kevin.



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