there seems to be a problem within the silverlight RadGridView. If I have input on a sorted column the current item gets lost if I jump out of the grid. You can reproduce this in your demo:
http://demos.telerik.com/silverlight/#GridView/Selectors/DataTemplateSelectors/CellEditTemplateSelector
Just sort the column ProductName, then change a ProductName. If you now focus something else on the page (e.g. the description on the left hand side) the grid gets resorted and the current item is lost (and an other item gets active).
Please help and if possible provide a quick workaround.
Thanks
Sven
8 Answers, 1 is accepted
I have checked the behaviour that you described. The same will happen if you change a ProductName and commit the edit (when you press Enter for example). When the edit is committed the column is resorted.
Would you please let me know what scenario would you like to achieve?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
thanks, for your quick reply. My expected behavior is to simply stay on the record.
Example, in my case I use a RadTabControl. On the first tab I have the RadGridView to show/edit main data. On the second Tab I have details. So if I change the value of the sorted column and jump to my details (click on the 2nd tab)
the current item is not the one that I expect. In the background the RadGridView was resorted and changed the current item and now the details tab is showing me details of the wrong record...
Sven
To achieve that you should set the ActionOnLostFocus property of the GridView to be "None". By default it is "CommitEdit" and that is why you experience such a behaviour.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
And thanks again for your reply. The behavior seems working if I bind to a collection directly. Unfortunately I use a
QueryableCollectionView which seems to ignore this setting...
Any suggestion?
Sven
Would you please set the "IsContentPreserved" property for the RadTabControl. By default RadTabControl unloads the content of the previous tab (unless RadTabControl.IsContentPreserved property is set to true) and this should be the reason for your issue.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
still not working. I have an ugly workaround by subclassing the QueryableCollectionView, overriding the CommitEdit() and not firing base implementation...
Any other suggestion?
Sven
So far I cannot reproduce the issue you have and I cannot suggest further.
Please find attached my test project. Would it be possible for you to change it so that I can see the problematic behaviour?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
took me a while to extract my solution code into your example to examine the behavior. While doing that I encountered the following situations where a commit happens unintentionally:
1. Setting GridView's ActionOnLostFocus="None" in a Style and RadTabControl's IsContentPreserved="False". Setting ActionOnLostFocus at control level, IsContentPreserved can be true or false -> no commit here.
2. Adding a Column with a CellTemplate (CheckBox) and Binding. A commit is triggered when IsContentPreserved="True" and ActionOnLostFocus="None" is set at control level. Note that in this case setting IsContentPreserved="False" stops committing!
I'm opening a support ticket to submit the solution.
Thanks
Sven