DatePicker - Validation Rules

May 22, 2009 at 7:48 PM


Do you know of any good way to bind a datepicker with validation rules?

What I wanted to do is something like this:

        <toolkit:DatePicker Name="dpActualStartDate" Grid.Column="1" Grid.Row="4"
                            HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"
                            HorizontalAlignment="Left" VerticalAlignment="Center"
                            Height="25" Width="250">
                <Binding Path="ActualStartDate"
                             NotifyOnValidationError="True" >
                              <buisness:DateValidation />

The xaml code above will not build because ValidationRules is NOT a binding member. Is there any alternative solution to get validation bound to a DatePicker?

Many thanks...

May 22, 2009 at 8:18 PM

Binding does have a property called ValidationRules:

What is the exact error you get?  Does your buisness:DataValidation derive from ValidationRule?


May 22, 2009 at 8:31 PM

ValidationRules doesnt seem to be a property of Binding if the Binding is implemented using the DatePicker control... If this was a TextBlock control, then Binding with Validation Rules is fine.

Aug 24, 2009 at 5:10 PM

Do we have an answer for this?