My problem is the following:
I have a ChildWindow that gets an Entity that is editable.
I use DataAnnotation attributes to set the validation rules.
My Entity has a Name property and Required attribute is applied on it.
If I modify an existing Entity and I clear the textbox that is binding to the Name property I get a validation error that the name field is required.
But when I add a new entity and the Name property is null the validation doesn't work.
I set the Name property to String.Empty in the constructor of the class and I display the Entity in the childwindow the validation error is showing in the textbox.
What is the best solution?
Can I set the button that is showing the childwindow to doesn't fire the validation?
In Asp.NET the button control has a IsCausesValidation property that is false the button doesn't fire validation.
Thanks advance l,