I create a grid that allows to modify data directly in the gridviewrow by invoking the "BeginEdit()". But when I call the CancelEdit() the data isn't revert to the initial value --> do you have any solution for this?
It seems that data on row isn't refreshed--> after cancelEdit() --> I can BeginEdit() again --> data (of editing cell) is refreshed to initial value.
Thanks!
8 Answers, 1 is accepted
This would be the expected behavior since RadGridView commits the edit on loosing the focus. What you can try is to set its ActionOnLostFocus property to "None".
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
The datacontext is still at initial value after CancelEdit() but the gridrow isn't refreshed. I call BeginEdit() --> data refresh then (initial value)
I am attaching the sample project I used for testing the case. Would you take a look at it and let me know whether it corresponds to your scenario or I am missing something ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
But in my situation --> I still have focus on the row
I'll prepare an example & upload here
Would it be possible to provide a bit more details on your exact scenario ? Can you get the same behavior on the sample I previously attached ? Is there something more that I need to do in order to reproduce the issue
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I do as the following:
1. Click on EditButon of grid
2. Modify some data
3. Click on Cancel button
--> data isn't reverted
http://www.mediafire.com/?3aywt92e4p09wgf
Thanks for your help!
From what I see in the project your Data class does not implement INotifyPropertyChanged, therefore it isn't possible to synchronize the Gridview cells on CommitEdit without calling Rebind(). This actually solves the CancelEdit problem as well. I am attaching a modified version of your project. The only change I made is that the Data class is now deriving from ViewModelBase.
Nikolay Vasilev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>