locked
validation not working on date picker control RRS feed

  • Question

  •  i am trying to do validation between date1 and date2 for this i am using date picker controls binding properties are string the problem is validation is not working on it, since numeric validation is working fine.

     

    i am using

    Implements INotifyPropertyChanged 

    and under setter using

    Public Property EndDate() As String
                Get
                    Return _endDate
                End Get
                Set(ByVal value As String)
                    If StartDate > value Then
                        Throw New ValidationException("Error")
                    End If

                    _endDate = value
                    RaisePropertyChanged("EndDate")
                End Set
            End Property

     Can u please tell me what is the issue

     

    Thanks

    Monday, April 19, 2010 8:16 PM

Answers

  • Hi,

       I just tried it should work.

      You may set a break point in your setter .

      Also I see that your EndDate is of type string. But the selectedDate of datepicker is of type DateTime.

      Maybe you should work on that.

    Best Regards

    Wednesday, April 21, 2010 1:32 AM