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

Can I hide Data errors in edit mode

3 Answers 72 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 06 May 2016, 11:20 AM
I have a gridview that has some errors using DataErrorInfo. When in edit mode, I use cell_validating to potentially set an edit error. However, I then get 2 error controls (red border) overlapping each other. Is it possible to hide or switch off the data layer errors whilst in edit mode?

3 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 09 May 2016, 10:21 AM
Hi Jason,

Setting the ValidatesOnDataErrors property of RadGridView to "InViewMode" should disable the Error message that comes up from the IDataErrorInfo interface and only the validation error related to the CellValidating event. Can you please test setting it and update the thread whether this is the functionality you aim for?

Regards,
Stefan Nenchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Jason
Top achievements
Rank 1
answered on 11 May 2016, 08:09 AM

I had the grid set up in that manner already. My actual issue was that the custom editor had the ValidateOnDataErrors property set to true (which was the default). Switching this off on construction of the editor hid the data errors as I wanted.

 

Thanks

0
Stefan Nenchev
Telerik team
answered on 11 May 2016, 09:58 AM
Hello Jason,

Great to hear that you have resolved the validation duplication. I am adding a code snippet on setting the ValidatesOnDataErrors property in CellEditTemplate in case some other member experiences a similar issue:

<telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding SomeProperty, ValidatesOnDataErrors=False}"/>
                        </DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>

In case your scenario is different, you can also add the approach from your end.

Regards,
Stefan Nenchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Jason
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Jason
Top achievements
Rank 1
Share this question
or