开发者

WPF ComboBox DataBound Event?

开发者 https://www.devze.com 2023-01-14 00:31 出处:网络
I use Co开发者_高级运维mboBox.ItemsSource=[some data collection] to bind data to the control. I want to hookup an event handler to the combobox so that whenever its data updated (or first time bound)

I use Co开发者_高级运维mboBox.ItemsSource=[some data collection] to bind data to the control.

I want to hookup an event handler to the combobox so that whenever its data updated (or first time bound), I can do somthing.

The problem is I can't find an appropriate event for it. The close guess is DataContextChanged. But that is not invoked when the items get bound/created.

Many thanks in advance for any helps.

Cheers~


The ComboBox.Items property is of type ItemCollection, which has CollectionChanged, CurrentChanged, CurrentChanging events. They should suit your needs.

ItemCollection Class MSDN Article

0

精彩评论

暂无评论...
验证码 换一张
取 消