This is a migrated thread and some comments may be shown as answers.

Force AddNew although item has errors

1 Answer 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marius
Top achievements
Rank 1
Marius asked on 14 Dec 2010, 01:22 PM
I'm porting from DataGridView to RadGridView and I am currently having problems with the validation logic in the RadGridView. I want to add the new item to the ViewModel collection directly after "Click here to add new item" has been invoked, but since the item has validation errors exposed through IDataErrorInfo, the RadGridView wont commit. How can I alter the behaviour of the RadGridView to commit new rows to the datasource directly after creation of a new row?

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 16 Dec 2010, 02:52 PM
Hello Marius,

You may take a look at this forum thread for a reference. Basically, there are a couple of options for achieving asynchronous validation. Firstly, you may try to work with the ValidatesOnDataErrors property of the grid and set it to "InViewMode".  If you want to skip the validation of the grid as a whole, you may set the same property to "None". You may take a look at our online documentation for further reference.
Another possible approach may be to perform the asynchronous validation as the way it is demonstrated in this blog post.
However, please keep in mind that those methods will be applicable if the validation fails in correspondence with the logic inside your business object. If you try to insert letters for example in a cell requiring numbers, the .Net platform will not allow you to. 
I hope that helps. Let me know in case you need any further assistance.

Regards,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Marius
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or