Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
221
Invalid value in cell. How to avoid error dialogbox "Value in the editor is not valid"
posted

I have a grid in which certain columns/cells have a MaskInput and Format. For example:

column.Format = "dd/MM/yyyy";
column.MaskInput = "dd/mm/yyyy";

This all works fine as long as the entered data can be converted to the column DataType (in this case obviously DateTime). But if the user accidently enters __/__/2008 the conversion fails and a popup is shown with following error message:

Unable to update the data value: Value in the editor is not valid.

Is it possible to supress the error dialogbox? I don't want it to show. I would prefer the grid discards the invalid entered info (and reverts to the old value) or enters a default value.


- Infragistics .NET Advantage for Windows Forms 2008 Volume 2


Thanks! 

Parents
  • 1803
    Verified Answer
    posted

    Hi Marc,

    There is an CelldataError Event ..use that and withinset

    e.RaiseErrorEvent = False

    If u want to retain the old value u set this prop

    t = False

    e.RestoreOriginalValue=true

    to stay in edit mode

    e.StayInEditMode

     Hope this helps you ........

     hppy koding ,

    Arun

Reply Children