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
140
How to Disable DataError
posted

Hi,

I using xamDatGrid , While editing certain entry if i delete contents in string value type  field , it throws bellow exception.

Object of type 'System.DBNull' cannot be converted to type 'System.String'.

As i am doing my validation separately on my DataContract level, Could you please suggest any solution to suppress this error and proceed with default values of field.

 Please its urgent.

Parents
No Data
Reply
  • 69686
    posted

    Hello,

    Every cell in the grid consists of a xamEditor which holds the value of the cell. If some validation is to be done or removed it should be performed within this xamEditor. The grid itself does not have a property which turns on and off validation as many users ask.

    About this problem, why don't you try to handler this exception in the EditModeEnding event and check if the new/edited value is DBNull and return a proper string.

    Hope this helps. 

Children