An expiration date is required for a license unless it is a lifetime license. I have two controls; a ComboBox for the license type and a DateTimePicker for expiration date. I have created a class called RequiredExpirationDateValidationRule.
The only way to invalidate just the DateTimePicker appears to be to place the RequiredExpirationDateValidationRule in the binding for the SelectedDate property of the DateTimePicker. However, I can't get the SelectedItem property of the ComboBox
to see if I have a lifetime license type selected. So I have to place the RequiredExpirationDateValidationRule in a BindingGroup that includes both the ComboBox and the DateTimePicker. But now the DateTimePicker is not invalidated by the RequiredExpirationDateValidationRule
when it returns a false ValidationResult.
How do I solve this problem?
View Complete Post