Currently, I have a DataGrid which is bound to some data in my ViewModel. I have ValidationRules set up for the Rows, and the Columns. What I would like to do is prevent the user from saving the file if there are any Validation Errors. I am using the RelayCommands class to route the Open, Save, etc commands to my ViewModel.
Prevent Save when Validation Errors occur on WPF DataGrid
6.2k Views Asked by s73v3r At
2
There are 2 best solutions below
0
jbe
On
You might be interested in the BookLibrary sample application of the WPF Application Framework (WAF). It disables the Save button when a validation error is active (e.g. DataGrid).
Related Questions in WPF
- WPF MessageBox Cancel checkbox check
- WPF multiple control property simultaneous changes
- ObservableCollection.CollectionChanged does not select the correct DataTemplate on ToolBar
- Telerik's WPF RadColorPicker NoColorText property not working
- How to automate UI interaction during acceptance test run
- Binding to "this.property" object in VisualStateMenager
- ContextMenu Closes Immediately
- Update ObservableCollection where the items are received from another List
- change content button with trigger
- WPF - How to highlight a combobox border when focused
- Wpf No Highlight on ListBoxItem for Touch Devices
- WPF WebBrowser how best to get Tag trees
- Make a class suitable for Property Change Notification
- WPF Comparing two datatables to find matching values
- how to create folder and file with datetime in wpf application
Related Questions in VALIDATION
- Escape dot in jquery validate plugin
- PHP form validation: Where to plop the code
- i want to create a service that does the login functionality?
- Stray start tag head, Element style not allowed as child of element body in this context. (Suppressing further errors from this subtree.)
- Html File Input on Chrome for Android missing extension and mime type
- javascript check input fields are not blank and check input field length?
- Symfony 2 form - date widget and validator
- Bean Validation message interpolation with array constraint parameter used as variable in message
- Bash regular expression execution hangs on long expressions
- Accessing the main object in a javax.validation.ConstraintValidator
- RAILS: date_select validation
- How can I define items of an array in a form in AngularJS
- Validation DataGridView Windows Forms
- How to handle multiple if statements PHP
- Restrict comma in asp.net textbox
Related Questions in DATAGRID
- Login form by using a new database, made in VB
- Exporting Datatable
- WPF DataGrid Move to last selected row without highlight recent clicked row
- reactjs datagrid use html
- C# WPF DataGrid - Processing a Dictionary inside a class into column components in the datagrid
- WPF converter column ItemsSource
- Edit DataGrid Cell on mouse over
- Can't put Dropdownlist into a Datagrid
- Outter joins in LINQ query
- Update DataGrid cell if other cell changes
- Binding DataGirdComboBoxColumn to DataSet doesn't work
- Wpf datagrid scrollbar freezes
- Why is wpf UpdateSourceTrigger not binding explicitly?
- GWT DataGrid column width issue after removing columns
- DataGridRowTemplateColumn - refactoring and using styles efficiently?
Related Questions in RELAYCOMMAND
- How to make command not disable button when clicked
- RelayCommand called in "old" DataContext
- UI Validation before executing RelayCommand WPF
- Prevent Save when Validation Errors occur on WPF DataGrid
- How do I test Relaycommand?
- ViewModelLocator not firing up
- Call RelayCommand in WPF-Control from WPF-Windows (XAML)
- how to use EventToCommand in a ItemContainerStyle?
- Binding generic type through MVVM Light RelayCommand
- EventToCommand issue in MVVM Light
- Moving from RelayCommand to ReactiveCommand
- Passing eventargs and sender to the command without mvvmlight
- In MVVM Community Toolkit VM I load a Person(with 20 observable props), in V I display Person's data. How to enable SaveButton on any data changes?
- usercontrol button binding not responding to relaycommand on mainviewmodel
- Binding BindableApplicationBarIconButton IsEnabled property to Relaycommand CanExecute Windows Phone 7.1
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Check the below links
Disable Save button in WPF if validation fails
Using WPF Validation rules and disabling a 'Save' button
http://babaandthepigman.wordpress.com/2010/02/14/wpf-commanding-and-data-annotations-validation/
Hope this helps...