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

RadGridView and Validation

13 Answers 552 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 02 Sep 2013, 03:11 PM
Hello everybody,

After migration to new Telerik Controls 2013 Q2 I've faced with some issues in grid view validating.

All items which bound to RadGridView have two validation attributes: Require from System.ComponentModel and my own attribute which inherited from ValidationAttribute.
WIth new Telerik assemblies it is incorrect row highlighting after validation was finished. Row is valid actually, but it has error message and error background (in attached screenshot). If you scroll grid up and down, than background will become normal and error message will disappear.
In debugger when code in RowValidated handle row has IsValid=true, but row Errors collection have 1 error description.

I've attached sample project where this issue is reproduced.

Do you know any ways to workaround this issue?
Thanks!

13 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 03 Sep 2013, 08:53 AM
Hello,

Thank you for the provided details. I have logged the problem into our Public Issue Tracking System and you can track its status here.
As a workaround, I would suggest you to set RadGridView.ValidatesOnDataErrors property to InEditMode.

I hope this helps.


Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Denis
Top achievements
Rank 1
answered on 03 Sep 2013, 12:45 PM
Hello, Vera

Unfortunately, the workaround you suggested is almost work. But eventually I can get the same result in validation.
There are several actions to do:
1) Add valid row
2) Make row invalid (clear any of Code or Text cell in my example)
3) Try commit invalid row (press enter)
4) Cancel editing (press esc twice)

As a result, row will get valid values like after step 1), but it will highlighted as invalid with error message.

Do you have any ideas to avoid this?
Thanks
0
Vera
Telerik team
answered on 04 Sep 2013, 01:21 PM
Hello Denis,

Thank you for the additional details. We will have them in mind when testing the fix for the problem. Hopefully, it will be resolved soon.

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Denis
Top achievements
Rank 1
answered on 25 Oct 2013, 02:26 PM
Hello Vera,
I have noticed that this validation problem has already been solved. Could you tell me in which version of Telerik Controls this bugfix will be included?
Thanks.
0
Vera
Telerik team
answered on 28 Oct 2013, 09:19 AM
Hi Denis,

I would suggest you to download our latest official version - Q3 2013 and to give it a try.

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Denis
Top achievements
Rank 1
answered on 28 Oct 2013, 09:55 AM
Thanks for answer.
Indeed, before I wrote my previous message, I've already tested lastest versions with hotfixes 2013.3 and 2012.2.0805.
But I can still reproduce this incorrect behavior I've describe earlier.
0
Vera
Telerik team
answered on 28 Oct 2013, 10:14 AM
Hello Denis,

Please find attached your project updated with binaries from Q3 2013. Do you get the unwanted behavior on it? Is there something I am missing?

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Denis
Top achievements
Rank 1
answered on 28 Oct 2013, 04:34 PM
Actually, yes. I've still got unexpected behavior. There are some steps to reproduce this:
1) Clear "Text" cell of any row to get invalid row
2) Press Enter to apply changes. After that we got validation error "Code and Text should not be empty together" screen1
3) Press Esc to cancel previous changing. Error is still shown, but it's OK, because we in Edit mode now. screen2
4) Press Esc again to exit from edit mode. Error is still shown, but I'm expecting that row will be validated again and error message will disappear, because row is valid now. screen3

If I shrink main window enforcing scroll viewer to appear, and than make scroll down (to hide error row) and up (to show it again) - error message and red border around row will disappear.

Can you reproduce this now?
0
Vera
Telerik team
answered on 29 Oct 2013, 11:02 AM
Hi Denis,

Please excuse me for the misunderstanding. In this particular scenario (when Escape key is pressed, i.e. GridViewEditAction is Cancel) the row remains invalid due to the error that is left. With Q3 2013 RadGridView provides an API to clear user defined errors. We introduced a new property inside RowEditEnded event args named "UserDefinedErrors" which represents a generic IList<string> with all user errors for that row.
What you can do is to handle RowEditEnded event and clear these errors (which will update valid state). Please find attached your project updated accordingly.

Let me know how it works on your side.

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Denis
Top achievements
Rank 1
answered on 08 Nov 2013, 05:06 AM
Hello Vera,
This workaround works fine, but anyway it has unexpexted behavior, doesn't it? I thought, row should re-validate itself after editing. 
I wonder, this a normal behavior that won't be changed in next releases; or it is some kind of bug? 
0
Vera
Telerik team
answered on 08 Nov 2013, 10:04 AM
Hi Denis,

Could you please share more details on this unexpected behavior?

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Denis
Top achievements
Rank 1
answered on 08 Nov 2013, 10:23 AM
Hello Vera, 

I called the "unexpected behavior" of the fact that row does not re-validate itself after row editing was cancelled. And we as a developers must clear collection with errors.

I think it is some kind of bug, because I can imagine situation when row was invalid initially, than we make it invalid with other error and then we cancel editing. In that case row will be invalid actually, but in workaround you suggested we will remove this error from collection. Thus the workaround won't work properly for this situation.
0
Vera
Telerik team
answered on 11 Nov 2013, 01:33 PM
Hello Denis,

Currently, we cannot provide any other solution. As for the scenario you mentioned, you should not experience any problems in your particular case.

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Denis
Top achievements
Rank 1
Answers by
Vera
Telerik team
Denis
Top achievements
Rank 1
Share this question
or