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

RadGridView Validation

4 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 29 Mar 2012, 11:47 AM
We have an application that uses RadGridView.
We use RadGridView collection of objects that have attributes of validation.
There is also a button on the ToolBar that switches on edit mode of objects (editing is disabled by default).
The problem is that when you add a new object that does not pass validation and disable the editing mode, the application crashes with StackOverflowException.
If the button Edit Mode is not on the ToolBar everything works fine.

List the steps to repeat this behavior:
1) Press the Edit Mode (on the toolbar)
2) Add a new blank line (by pressing Ins)
3) Cancel the edit mode by clicking the Edit Mode (on the toolbar)
4) Click on any item on the main window
5) get the exception

If in p.3) you press the the EditMode button not on the toolbar everything will work fine without any exceptions.

UPD Sample project in archive 

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 29 Mar 2012, 11:49 AM
Hello Denis,

Can you please try attaching the sample again ?  It seems it is missing.

Regards,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Denis
Top achievements
Rank 1
answered on 30 Mar 2012, 06:50 AM
I'm not sure that you get sample project so I add link with it again.
Sample project in archive  
0
Pavel Pavlov
Telerik team
answered on 03 Apr 2012, 01:13 PM
Hello Denis,

Thanks for sending the project. I have made a few tests with it. Here are my findings:

In the root of the trouble there is  a setting:

CanUserInsertRows="{Binding IsEditMode}"


This forces RadGridView to enter kind of impossible state - the user can not insert a row , however we are in the middle of inserting a row.

To solve the issue you may need to either call the CancelEdit() method of RadGridView  or invoke the relevant command of RadGridView , before switching the "IsEditMode" property to false.


Kind regards,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Denis
Top achievements
Rank 1
answered on 05 Apr 2012, 11:27 AM
Hello Pavel, 
Thanks a lot for your response.
This solution works good.
Tags
GridView
Asked by
Denis
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Denis
Top achievements
Rank 1
Share this question
or