Reputation: 4741
I have a textbox and some labels inside the data template of bounded listbox.
When I click on any label the whole item is highlighted in blue, but when I click directly on a different textbox the selection does not change.
Is there a way to make the selection of the listbox change even when a textbox is clicked?
thanks
Upvotes: 0
Views: 202
Reputation: 34200
The reason is because the TextBox handles the click event in order to receive focus. There are a number of ways to handle this, including but not limited to:
Upvotes: 0
Reputation: 62484
This is what I've exactly asked few days ago, see post: "WPF: Trigger SelectedIndex changed whilst clicking on any control within a ListBoxItem area"
basically there are few solutions, using code behind and XAML, but I've not verified latter approach yet
Upvotes: 1