Click here to Skip to main content
14,300,487 members
Rate this:
Please Sign up or sign in to vote.
See more:
I get ComboBox does not contain definition for SelectionChangeCommitted am I missing a using directive or an assembly reference?

What I have tried:

Tried searching the web for an answer.
Posted
Updated 5 days ago
Comments
Gerry Schmitz 10-Sep-19 14:52pm
   
"Committed" to what? You're probably looking for "SelectionChanged".
Member 14178707 10-Sep-19 14:59pm
   
SelectionChangeCommitted Occurs when the user changes the selected item and that change is displayed in the ComboBox
dnxit 12-Sep-19 1:52am
   
SelectionChangeCommitted was available in windows forms it's not available in wpf, if you want to customize Selected Item Change, you can check this article for custom event

https://www.codeproject.com/Articles/39077/Binding-to-ComboBox-SelectedItem-through-a-custom
Member 14178707 5 days ago
   
Thank you very helpful.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

As far as i know there's no SelectionChangeCommitted event for combobox in WPF. SelectionChangeCommitted[^] is reserved for combobox in WinForm.

You can use the following events:
1) ComboBox.SelectionChanged
or
2) ComboBox.DropDownClosed
or
3) ComboBoxItem.PreviewMouseDown

More at: c# - What event handler to use for ComboBox Item Selected (Selected Item not necessarily changed) - Stack Overflow[^]
   
Comments
Member 14178707 5 days ago
   
Thank you.
Maciej Los 5 days ago
   
You're very welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100