Print Page | Close Window

ESC key will ignore DecimalRangeVerifier validation error in XtraGrid and accept the invalid value?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2833
Printed Date: 28-Mar-2024 at 5:58am


Topic: ESC key will ignore DecimalRangeVerifier validation error in XtraGrid and accept the invalid value?
Posted By: Suah
Subject: ESC key will ignore DecimalRangeVerifier validation error in XtraGrid and accept the invalid value?
Date Posted: 15-Jul-2011 at 8:05am

DevForce 5.2.8 XtraGridBindingManager +DevExpress 9.3.4

DevForce generates validation attributes of DevForce type.

I've written verifiers in the entity class to be used in the way of DevForce validation via verifier .

Most of them work fine, if there's a validation error in a cell, press ESC key will revert the value back to the original valid value. (Works fine with a stringLengthVerifier).

But with a decimalRangeVerifier, the strange thing is press ESC key will ignore the validation error and accept the value.

Have you ever noticed similar problem before? Any suggestions?


A:

Hi Vincent,

Thank you for contacting us.

Since the problem occurs only with the XtraGridBindingManager component, it is likely related to its implementation. In any case, we will do our best to help you.

When an ESC key is pressed, our GridView just destroys an active editor without saving its value. This means that this value comes from another place. Try to handle the http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsBaseColumnView_CellValueChangedtopic - View.CellValueChanged event, type some invalid value in a cell and press the ESC key. Is this event raised during typing? If so, please put a breakpoint in this event handler and send us the resulting stack trace. We will try to find the culprit.

BTW, Please don't forget to uncheck the Enable Just My Code (Managed Only) checkbox in the Debugging node of the Visual Studio Tools | Options... dialog. Otherwise, your call stack will be incomplete.

Looking forward to hearing from you.

Thanks
Dimitros


Reply:

Thanks Dimitros,

I've tried the CellValueChanged event,

{
give an invalid value, press Enter triggers the validation error(Editor keydown then validatingEditor event fired,
before leaving validating editor event handler, by looking at the Entity it still has the old valid value).
press ESC key, editor keydown event fired, no validting editor event or cellValuechanged event fired,
this ignore the validation error and accept the invalid value,
}

If type an invalid value and don't press Enter key to validate, press ESC key will close the editor and discard the change.

 (My trouble is DevForce's DecimalRangeVerifier).


//===========

Any one know this problem?




Replies:
Posted By: Suah
Date Posted: 15-Jul-2011 at 6:18pm
Tried to put in a NumricRangeConverter into the XtraGridBindingManager, now it works.



Print Page | Close Window