I have a simple function that tries to get a value from an Obout grid filter column, and if the value is empty, ignores it and moves. For some reason, this code ignores my catch block and always throws a System.FormatException when the input string is empty!
More strange, if I use the visual studio debugger and set a breakpoint on this line, the catch block functions normally (after I continue with this line). I have already confirmed that my Debug | Exceptions | CLRs are not set to catch on a throw. I also confirmed the same behavior in the production version.
'Get the month selected Dim MonthSelected As Integer Try MonthSelected = CInt(DateCreatedColumn.FilterCriteria.Value) Catch ex As Exception 'If value is empty / not a number reset the filter DateCreatedColumn.FilterCriteria.FilterExpression = String.Empty Return End Try
source share