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

GridView CommitEdit & InViewMode problem using DataForm

7 Answers 205 Views
GridView
This is a migrated thread and some comments may be shown as answers.
José
Top achievements
Rank 1
José asked on 24 May 2011, 04:51 PM

Hi,

I'm updating my application to the latest release of RadControls for Silverlight (Q1 2011 SP1).

I use a RadGridView inside of a DataForm and I've found a problem when the ActionOnLostFocus is set to "CommitEdit"  and 
ValidatesOnDataErrors is set to "InViewMode": when we are editing a cell so that it will result in a validation error, and we move the focus outside the GridView (for example, into a RadTimePicker) the browser gets unresponsive (freezes).

I’ve also tested and got the same problem using the lastest available hotfix (2011_1_0516).

This happens with both DataForm and RadDataForm.

Is this a problem from the current release or am I doing something wrong?

Thanks in advance,
José

7 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 25 May 2011, 07:20 AM
Hello José,

Would you please send us the project, utilizing RadGridView and RadDataForm, in order to help us resolve your issue. Excuse me for the inconvenience. 

Best wishes,
Ivan Ivanov
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
José
Top achievements
Rank 1
answered on 25 May 2011, 12:42 PM
Hi Ivan,

Here's a sample project using RadDataForm with RadGridView: http://dl.dropbox.com/u/6799527/Telerik.zip

In the sample you'll find 3 blocks, the top grid from each blocks has ActionOnLostFocus="CommitEdit" and ValidatesOnDataErrors="InViewMode".
Only the left block will not give any problem.


How to simulate in the center and right blocks: 
1- Press the "Create new" from the data form
2- Press the Add Line button
3- In the Top GridView insert an invalid data into the Property_3 (for example, an alphabetic word)
4- Set the focus to the DatePicker above or into the RadGridView bellow
0
Ivan Ivanov
Telerik team
answered on 31 May 2011, 12:20 PM
Hi José,

I have inspected your project carefully and I have noticed several disturbing issues:
    - Please, do not place RadGridView instances in containers that measure their children with "infinity". This will possibly cause performance issues, as RadGridView's virtualization logic won't get enabled.
    - You do not really need these TwoWay bindings. The correct way of handling the data flow in scenarios like yours is to manage it through RadDomainDataSource's RejectChanges() and SubmitChanges() methods. 
    -As for the main topic of our communication, I noticed that the scenarios you are comparing are actually quite different. In the first one the two RadGridViews are bound directly to RadDomainDataSource's DataView. This is the recommended way to deal with such situations and consequently there are no issues with this approach. On the other hand, in the other two examples the RadGridViews, which are placed in DataTemplates, are bound to properties that may not be initialized when the binding takes place. Moreover, you are changing them manually outside the RadGridView logic.
To put it clear, I would advise you to reorganize your project's architecture. You may have a look at our examples with RadDomainDataSource, in order to see the recommended practices in such scenarios.
Please, do not hesitate to contact us if any further inquiries on this issue occur.

Greetings,
Ivan Ivanov
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
José
Top achievements
Rank 1
answered on 31 May 2011, 01:25 PM
Hi Ivan,

This is a sample project made for one purpose, and cleary architecture was not a concern and I don't see how it affects the problem I was trying to point out.

The problem is not when using the (Rad)DomainDataSource but when using a RadGridView inside a (Rad)DataForm.

W
hen you loose the focus from the RadGridView Cell inside a DataForm to another control, if there's an error coming from the Data Validation in the CommitEdit of that grid view cell, the validation enters into a loop.

So, what is the correct way to implement, and avoid the issue I pointed out, a RadGridView inside a DataForm in a Master-Detail scenario following the MVVM design-pattern where I have custom code when I want to create the detail item?

Thanks.
0
Ivan Ivanov
Telerik team
answered on 06 Jun 2011, 04:10 AM
Hello José,

Please, try subscribing to RadGridView's BindingValidationError and set e.Handled to true, in order to prevent this infinite loop. In this way the validation should work as expected.
 
All the best,
Ivan Ivanov
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
José
Top achievements
Rank 1
answered on 14 Jun 2011, 04:36 PM
Hi Igor,

I still get the same error since the BindingValidationError isn't raised before the error happens.
Did you manage to reproduce the problem?
0
Ivan Ivanov
Telerik team
answered on 15 Jun 2011, 09:13 AM
Hello José,

Yes, I have successfully reproduced this issue. Please, refer to attached project that illustrates the approach that I have described in my previous post. In order to reproduce this scenario, please enter an incorrect value in a cell from the "Number" column.

Greetings,
Ivan Ivanov
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
Tags
GridView
Asked by
José
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
José
Top achievements
Rank 1
Share this question
or