My question is, what makes SelectedItems stop responding to changes? Is it the fact that somehow the Unloaded event is fired, or is that just a coincedence? I've tried creating the grid in a simple standalone application, but the SelectedItems collection always responds to changes. I can't help but think this is causes by by the underlying FrameworkElement being unloaded.
9 Answers, 1 is accepted
I've just tried this with grid nor part of the visual tree however everything worked as expected. Here is an example.
var grid = new RadGridView();
Why not use the MVVM approach demonstrated in this blog post? You can work directly with the view model instead RadGridView. Greetings,
Vlad
the Telerik team

Also, I have tried the binding method you proposed. No matter how we bind the grid, the behavior is the same. Should I open a support ticket on this?
Please open support ticket and send us an example application where we can debug the grid behavior locally.
Kind regards,Vlad
the Telerik team

I have exactlly the same problem.
Can you tell me if you've found a solution to resolve this issue.
Thanks & Regards
Radouan
This forum thread is quite old, so would you please share some additional details on your exact problem? Have you bound the SelectedItems collection to a property in your ViewModel? What is the version of the controls do you use, is it the latest version?
Didie
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

Thanks for quick replay.
My problem is exactlly described in this topic:
When the grid is placed in a docked document pane, we see problems. Manipulating the SelectedItems collection works as advertised until the pane visibility change to collapsed. Once the visibility is set to Visibile, the SelectedItems collection does not respond to .Add, .Remove, or .Clear methods.
I'm using the last version of Telerik RadControls for WPF.
Thanks.
I tried to reproduce the problem with the SelectedItems, but unfortunately I were not able to.
As I am not sure how you have defined the panes, I have attached my test project. Would you please change it to illustrate the issue?
Didie
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

Thanks for sharing your sample. I have changed your code and I can reproduce the issue, but I can't upload it.
What you should do (or what I have in my application) that reproduce this problem is changing the visibility of the grid that contain the main content, called usually RootLayout.
Please try to select elements and then Hide the main grid and after Change Visibliity to Visible of the main Grid, then your selectedItem is null.
Thanks & regards
Radouan
Indeed, there in not an option to attach project to a support thread. In order to be able to do so, you should open a support ticket.
I have modified the demo as per your description, but I am still not able to reproduce the issue.
Didie
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>