The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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.