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

Editing with no changes still commits value to model

9 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
StackOverflowed
Top achievements
Rank 1
StackOverflowed asked on 17 Dec 2010, 07:41 PM
I'm having some trouble understanding how the editing infrastructure in the grid works.

1) When I edit a value and press Esc once and then navigate away, nothing is set. However, if I press Esc twice, the setter for the model is triggered. Why?

2) If I go into editing mode and immediately press Enter, even though nothing has changed, the grid will still set the value on the model. Why? As a basis for comparison, the WPF toolkit grid does not exhibit this type of behavior.

3) Entering edit mode and navigating away from the cell by clicking somewhere else also exhibits the same issue.

All of these issues are present no matter what value I set ActionOnLostFocus to (I tried all 3).

Any ideas?

9 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 22 Dec 2010, 04:21 PM
Hi StackOverflowed,

Indeed with the current version of RadGridView this is an expected behavior. We definitely will extend this functionality (will revert values for only edited cells) and this improvement will be available in a couple of weeks just after New Year Eve. As soon as we introduce it we will make it public via "latest internal build" program so stay tuned.

Regards,
Nedyalko Nikolov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Andy
Top achievements
Rank 1
answered on 22 Dec 2010, 04:26 PM

0
StackOverflowed
Top achievements
Rank 1
answered on 22 Dec 2010, 04:28 PM
Can you explain what you mean by "will revert values only for edited cells"? My assumption is that you meant that it will only commit values for edited cells, whose values are different than the current one.

How will the 3 cases I described be handled? And can you explain why pressing Esc one and then navigate away, nothing is set; while pressing Esc twice does set the value to the underlying model? Does it have something to do with cell vs. row editing mode?

Can you describe briefly what changes you are making to the editing model and how you envision it will work in the upcoming release?

This is very important functionality to me so I'll be looking out for that internal build.

Thanks
0
Accepted
Nedyalko Nikolov
Telerik team
answered on 27 Dec 2010, 03:04 PM
Hello StackOverflowed,

I'll try to clarify what I mean by "will revert values only for edited cells". With the current version of RadGridView when row edit is canceled RadGridView reverts all values (for every column) to its original value (before edit starting). This causes an unnecessary hit to every property setter no matter if the cell that belongs to that column has been edited or not.

About your concerns 2 and 3 that we hit the underlying property setter, this will be solved by the same improvement. Right now RadGridView doesn't perform any check if cell has been edited actually (value is changed). RadGridView just updates property value with the value from editor when cell leaves edit mode. So we will improve our code to perform such checks which will resolve all issues.

Let me know if there is something unclear.

Best wishes,
Nedyalko Nikolov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
StackOverflowed
Top achievements
Rank 1
answered on 28 Dec 2010, 08:07 PM
Sounds good. I'll be looking forward to your changes. Thanks
0
StackOverflowed
Top achievements
Rank 1
answered on 05 Jan 2011, 05:20 PM
Any updates on this?
0
Nedyalko Nikolov
Telerik team
answered on 11 Jan 2011, 08:21 AM
Hi StackOverflowed,

Sorry for the delayed answer, I want to be sure that fix will be included in the upcoming service pack.
Service pack will be released in a couple of days.
Could you please try your scenario with service pack assemblies and let me know how it goes?
Have a nice day.

All the best,
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
StackOverflowed
Top achievements
Rank 1
answered on 12 Jan 2011, 06:21 PM
Has it been released yet? Also, is it possible to disable row editing?
0
Vlad
Telerik team
answered on 13 Jan 2011, 07:59 AM
Hi,

 The service pack should be released later today or tomorrow - if you do not want editing you can set IsReadOnly to true for the grid. 

Greetings,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
StackOverflowed
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Andy
Top achievements
Rank 1
StackOverflowed
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or