Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Validating input - CXTPPropertyGridItem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Validating input - CXTPPropertyGridItem

 Post Reply Post Reply
Author
Message
Kevin6 View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Location: United Kingdom
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kevin6 Quote  Post ReplyReply Direct Link To This Post Topic: Validating input - CXTPPropertyGridItem
    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



Edited by Kevin6
Kevin.
Back to Top
Kevin6 View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Location: United Kingdom
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kevin6 Quote  Post ReplyReply Direct Link To This Post 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.
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.139 seconds.