Hi,
I have a WPF application and I'm using using a dataset to perform CRUD operations.
I'm also using a ValidationRule for all the textboxes.
What I want is that if the user clicks the ADD or UPDATE button, I want to check if the window validates and if so then I want to Insert or Update data.
Validation
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Banketeshvar NarayanRank #235 · 10.5K reputationPosted Nov 13, 2015, 7:32 AM EST
The below links can help you:
http://www.c-sharpcorner.com/Blogs/50605/wpf-required-field-validation.aspx
http://stackoverflow.com/questions/18930125/wpf-validation-using-validationrule-class
http://www.codeproject.com/Tips/690130/Simple-Validation-in-WPF
Please mark as answer if it helps you.
Guest User25 reputationPosted Nov 17, 2015, 10:25 AM EST
Sorry for coming back you late.
Thank you for taking time to answer my question. The articles you suggest helped, but it's not enough for what I want to achieve.
What I want is to check if the Window validates like on WinForm:
if(this.Validate()){
dataset.tableFoo.AddNewRow(x)
}
Alternatively I want a command to disable the ADD and UPDATE buttons if the a validation fails.
I will really appreciate it if you can help.
Thank You.
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 17, 2015, 5:08 PM EST
Aloce Jorsen4 reputationPosted Nov 17, 2015, 9:46 PM EST