Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Data validation and error handling
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Data validation and error handling

 Post Reply Post Reply
Author
Message
Mirek View Drop Down
Newbie
Newbie


Joined: 27 June 2013
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mirek Quote  Post ReplyReply Direct Link To This Post Topic: Data validation and error handling
    Posted: 21 July 2013 at 11:39am
Hi Oleg,
 
When validating a grid-item with an incorrect value, I want to make two steps:
Step A/ - Display an error message explaining the error
Step B/ - Return the focus on the grid item with incorrect value (CXTPPropertyGridInplaceEdit window)
While Step A is quite easy (overriding the CXTPPropertyGridItem::OnValidateEdit() or CXTPPropertyGridItem::OnAfterEdit()), I cannot find any mechanism for implementing Step B. The problem is that CXTPPropertyGridItem::OnValidateEdit() is usually called on CXTPPropertyGridInplaceEdit::OnEnKillfocus(), which can be invoked by a number of various actions (messages, commands, ...), and I do not know how to interrupt/cancel such actions after displaying an error message. For example, I have two MDI child-frames, using the same property grid. If I enter a wrong value into the grid and click on the second child frame, the program displays an error message correctly but, after that, it continues and activates the second frame, which is bad. The frame-activation should be canceled so that the user could fix the incorrect value in the grid. I would be able to solve it for this action type (MDI frame activation) but it does not make any sense because there are hundreds of other actions causing the same problem. I believe that there should be a standard mechanism in your Property Grid, solving this problem on a general level. Please let me know if you know a solution or if there is a XTP-example in which I could find a solution.   
Thank you
M.
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.152 seconds.