Data validation and error handling |
Post Reply |
Author | |
Mirek
Newbie Joined: 27 June 2013 Status: Offline Points: 7 |
Post Options
Thanks(0)
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |