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

RadGridView SelectionMode Binding Does Not Work

5 Answers 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 19 Dec 2014, 04:31 PM
I have a SelectionMode Type Property in my ViewModel.  I have that bound to the SelectionMode of a GridView.  I am using INotify, but it doesn't appear that the GridView has any connection to that Property.  I don't get any errors, it just doesn't work.  I have lots of bindings to other things in the XAML that all work fine, so is there a problem trying to bind that particular property?

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 22 Dec 2014, 12:43 PM
Hello,

Generally the reason why the Binding does not work would be that that the Source of it cannot be resolved. You can try defining the ViewModel as a StaticResource and then set it as a Source for the Binding of child RadGridView. You can also check the Binding.Source Property as a reference.

Let me know if this works fine.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Stephen
Top achievements
Rank 1
answered on 22 Dec 2014, 01:04 PM
I have several other bindings for that grid, in the same view model as the one I am trying to use for SelectionMode and they all work fine.
0
Dimitrina
Telerik team
answered on 22 Dec 2014, 03:54 PM
Hello,

It should also work fine even when the Source is not explicitly set. I attached a demo project for a reference.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Stephen
Top achievements
Rank 1
answered on 30 Dec 2014, 08:56 PM
I see where you created a binding property, then put that in your xaml, but your triggering event is still the user in the code behind.  I need a way to change that value programmatically from the View Model (no user interaction).  I have events in my code behind right now, which do cause the state to change, but if I try to do it from my view model, nothing happens.
0
Dimitrina
Telerik team
answered on 31 Dec 2014, 12:49 PM
Hello,

May I ask you to try isolating the issue in a demo project illustrating your exact setup and attach it in a new support ticket ? You can also take a look at this blog post for a reference on how to isolate an issue. 

That way I can check it locally and advise further.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Stephen
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or