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

ComboBoxColumn SelectionChanged

1 Answer 162 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 22 May 2017, 09:57 AM
I know that the ComboBoxColumn doesn't expose a SelectionChanged event but I want to be able to handle this type of behaviour. I have a ComboBoxColumn with its ItemsSource bound to an OberservableCollection and its DataMemberBinding set to a property of the same type. When I change its selection I want to take an action; specifically, I want to set the value of another property to a value I determine in my . I want to use MVVM, so I don't want to add a handler to the grid  in .

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 25 May 2017, 08:39 AM
Hello Tim,

You can check the Handle SelectionChanged for GridViewComboBoxColumn help article to see how to subscribe for the event.

If you want to avoid using code-behind and do all the work in the view model, you can use the SelectedValueMemberPath property of the column. Each time the selection is changed, the getter of the property where the path points to will be called. There you can call your action.

Additionally, you can check the ComboBoxColumn SDK example.

Regards,
Martin Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or