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.
Unfortunately, activation email could not send to your email. Please try again.

Handling Invalid Format settings

Thread ID:

Created:

Updated:

Platform:

Replies:

31225 Jul 4,2005 01:20 AM Jul 4,2005 05:12 AM Windows Forms 1
loading
Tags: GridControl
Sue Harris
Asked On July 4, 2005 01:20 AM

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 05:12 AM

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.

CONFIRMATION

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.

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.

;