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
70
UltraNumericEditor ValidationError event problem
posted

hi infragistics,

i attended the following problem in UltraNumericEditor.

i set range (1 to 10) to UltraNumericEditor. the same form i put UltraComboEditor. i gave a message box in UltraNumericEditor_ValidationError event.

In running mode course focus set in UltraNumericEditor, value = 0. if course move to UltraComboEditor, UltraNumericEditor_ValidationError event mesage box display three times.

How to solve this problem

 

regards,

yuva, PremierEvolvics.

 

 

 

sample forUltraNumericEditor ValidationError event problem.zip
  • 469350
    Verified Answer
    Offline posted

    Showing a MessageBox inside the ValidationError event causes a problem because the MessageBox itself will force the control to lose focus, which will force it to get validated again and creates a recursive cycle. 

        Sometimes you can get around this by instituting a delay before showing the MessageBox. For example, instead of calling the MessageBox directly inside the ValidationError event, use a Timer or a BeginInvoke:

     
        Private Sub UltraNumericEditor1_ValidationError(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs) Handles UltraNumericEditor1.ValidationError
            'MsgBox("Value out of range ", MsgBoxStyle.Critical, "PELMessage (" & Now & ")")
            Me.BeginInvoke(New MethodInvoker(AddressOf Me.ShowError))
        End Sub


        Public Sub ShowError()
            MsgBox("Value out of range ", MsgBoxStyle.Critical, "PELMessage (" & Now & ")")
        End Sub