We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Handling Invalid Format settings

Thread ID:





31225 Jul 4,2005 05:20 AM UTC Jul 4,2005 09:12 AM UTC WinForms 1
Tags: GridControl
Sue Harris
Asked On July 4, 2005 05:20 AM UTC

Hi, In my virtual grid I allow the user to set their own Format settings. However, if the format settings is invalid (eg "d" date time formatting for a double value 1.403) the cell goes red with the text "Exception". What would be the best way of handling such invalid format settings such that in the example above it displays the minimum date (or some other random date) rather than erroring? Thanks, Sue

Administrator [Syncfusion]
Replied On July 4, 2005 09:12 AM UTC

The red X suggests that the problem is occurs while the grid is trying to paint the cell. Catching the error at this point is a little problematic as you would have to guess at what caused the particular exception (whether it is a format problem, or a invalid data problem, and something entirely off the wall). If you want to do this, you can try subscribing to the event Syncfusion.Windows.Forms.ExceptionManager.ExceptionCatched to get any exception thrown, and handle them yourself. But it will probably be simpler to somehow check the format at the point your user enters it to see if it is valid for the indicated range. At that point, a try catch block could be used to test the format against (some of or even all of) the indicated grid values to see if things arre OK before you leave the UI context of entering a format.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon