ComboBox Bind to TextBox

    General discussion

  • When i use ComboBox binding to a TextBox, i met three problems:
    1. The default Mode is "TwoWay" (maybe it's not a problem)

    2. UpdateSourceTrigger is always  "Property Changed"
     When i created a Converter between ComboBox.SelectedValue and TextBox.Text, even i have already set the UpdateSourceTrigger="LostFocus", it still behaved like "Property Changed". That said when i typed a letter in the TextBox, the correspoding Converter method will be trigged.

    3. Converter never trigged
    If I selected a item in ComboBox first, then no matter how we changed the content in the TextBox, the Converter will never be trigged.
    Thursday, July 19, 2007 7:21 AM

All replies

  • Hello, do you want to allow the user to type something in the TextBox, and select a correspond item in the ComboBox according to the text? Then you might want to make the ComboBox editable. Just set IsEditable to true. If you want to separate the ComboBox and the TextBox, I think you’re on the right track. Can you post some code so that we may find out your problem? One quick thought is have you set SelectedValuePath properly?

    Monday, July 23, 2007 4:55 AM