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

RadGridView validation and IDataErrorInfo

9 Answers 373 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 21 Jan 2011, 08:31 PM
I am using the RADGrid view in a WPF application and need to add validation for a couple of properties that are bound to the grid. I have implemented IDataErroinfo on may data object class that is the source of my binding. The validation is working almost like I need it to.

when the application loads and my property values are not valid the validation works as expected. My cells with invalid data is surrounded with a red line and I get the icon displayed in front of the row with errors. When I edit the cell and correct the data the red outline of the cell goes away it I tab out the cell or hit enter. However the error icon stays unless I hit the enter key or tab through all the cells in the row.

The behavior I am trying to achieve is that when the user leaves(by using the enter key,tab out of the cell or when the cell loses focus)  the cells and no other cells contain data the error icon disappears as well.

I am also using the cell validating event on the RadGrid view to validate the cell data and that seems to work except the error indicator stays there.

Thanks,
Alan Frye

9 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 24 Jan 2011, 01:02 PM
Hi Alan,

Could you please send me a sample project that demonstrates the described issue? I believe that we will solve the problem shortly.
You should open a separate support ticket in order to be able to attach files.
Thank you in advance.

Kind regards,

Nedyalko Nikolov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Rayne
Top achievements
Rank 1
answered on 08 Jun 2011, 06:35 PM
I'm having this problem as well.

When a user clicks the new row buttong to add a new row, I have validation checks in place to show errors immediately on fields that are required. But if the user cancels the new row, although the row goes away, the error icon in the row header does not go away, so my "new row" row has an error icon.

I cannot attach photos to show a screenshot of what my row looks like. How do I tell the grid to remove that error icon?
0
Nedyalko Nikolov
Telerik team
answered on 09 Jun 2011, 01:50 PM
Hi Rayne,

Could you confirm that you can reproduce the described behavior with our latest internal build?
If the issue persists, it will be very helpful to send me at least the code you are using to validate the new row.
Thank you in advance.

All the best,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rayne
Top achievements
Rank 1
answered on 09 Jun 2011, 06:13 PM
I just updated my project to the latest build (2011.1.0606) and it still does the same thing, but...

If I set ValidatesOnDataErrors = InEditMode then it doesn't do that, because it only reports validation errors when you in editMode for each cell. I'd like to be able to let the user navigate away from the row, but keep the Validation notifications so they know there is a problem.

I'm extending my EF entities using partial classes and implementing IDataErrorInfo to report validation problems. When I create a new entity, I'm adding validation errors to the entity so that the user immediately sees which fields are required (indicated by the red outlines on the cell).

Do you still need to see the validation code?
0
Nedyalko Nikolov
Telerik team
answered on 10 Jun 2011, 09:27 AM
Hi Rayne,

Generally if you want to enable such kind of validation (aka "asynchronous validation"), perhaps you need to set ValidatesOnDataErrors = InViewMode, this way the user will be able to see the errors and edit another item.

Indeed a sample project will be the best option in this case, but any information that could bring more light to the problem is welcome.

Regards,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rayne
Top achievements
Rank 1
answered on 10 Jun 2011, 02:04 PM
I will submit a ticket with a sample application.
0
haagel
Top achievements
Rank 1
answered on 30 Aug 2011, 01:13 PM
Have the issue with that icon that is not disappearing been resolved? I'm having the issue right know, but I'm not running the latest version of Telerik (I'm running 2010.3.1314.40). So my question is basically: will this issue go away if I update my telerik dlls?
0
Nedyalko Nikolov
Telerik team
answered on 02 Sep 2011, 11:36 AM
Hello Haagel,

Most probably the issue will be fixed, but I cannot be sure without a sample project.
If you send me a sample project (with steps to reproduce the problem), I'll check it against latest version and will notify you accordingly.

Best wishes,
Nedyalko Nikolov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Rayne
Top achievements
Rank 1
answered on 02 Sep 2011, 01:34 PM
I think if you update your controls, the problem should go away. It did for me. The version I'm using is 2011.2.712.40 and I no longer have the problem of the error icon staying after canceling a new row.
Tags
GridView
Asked by
Alan
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Rayne
Top achievements
Rank 1
haagel
Top achievements
Rank 1
Share this question
or