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
280
Validating on Enter in a UltraCalendarCombo
posted

i'm trying to add keywords to the ultracalendarcombo box to expedite entry of data.   The keywords are "Today", Tomorrow, and yesterday.  so the user types today and preses tab or enter and the ultracalendarcombo enters 4/22/2009 automatically.  I have this working perfectly under the ValidationError functionality when I type today and press tab however when I type today and press enter this code does not fire.  Is there a fundimental problem with my logic?

 

Private Sub ProductiveComboCalendar_ValidationError(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.DateValidationErrorEventArgs) Handles Me.ValidationError

    If Me.Text.ToUpper = "TODAY" Then

                e.NewValue = CDate(Now)

                OnValueChanged(e) '<-- the new value hasn't applied yet, so this doesn't 

            ElseIf Me.Text.ToUpper = "TOMORROW" Then

                e.NewValue = CDate(DateAdd("d", 1, Now))

                OnValueChanged(e) '<-- the new value hasn't applied yet, so this doesn't work

                            ElseIf Me.Text.ToUpper = "YESTERDAY" Then

                e.NewValue = CDate(DateAdd("d", -1, Now))

                OnValueChanged(e) '<-- the new value hasn't applied yet, so this doesn't work

                End If

 

End sub