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

Show Validation Errors on Save

1 Answer 75 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rebecca
Top achievements
Rank 1
Rebecca asked on 10 Aug 2012, 01:36 PM
Hi,

I am using the RadGridView throughout my application.
I have implemented the IDataError interface for all items that the RadGridViews are binding to.

I hope to set the RadGridVIews ValidatesOnDataErrors="InEditMode" so that validation issues are only apparent when the user is editing something.

However, when the user clicks the "Save" button, I retrieve a bunch of custom validation errors raised in my save logic and some of these validation errors may pertain to items being displayed in the RadGridView.

In this case, I would like to be able to show validation errors InViewMode.

How do I accomplish this?

Thanks

-Rebecca

1 Answer, 1 is accepted

Sort by
0
Rebecca
Top achievements
Rank 1
answered on 10 Aug 2012, 01:57 PM
I solved the problem by doing exactly what I said.

If there's a validation error on save, I set the RadGridView.ValidatesOnDataErrors=GridViewValidationMode.Default and rebind the grid so that everything is works the way it should.

After a successful save, I set it back to "InEditMode" and rebind.

-Rebecca
Tags
GridView
Asked by
Rebecca
Top achievements
Rank 1
Answers by
Rebecca
Top achievements
Rank 1
Share this question
or