开发者

how to extend wpf combo box to bind data?

开发者 https://www.devze.com 2022-12-24 20:27 出处:网络
i need to bind a collection of objects to a combo box which i can use开发者_如何转开发 in different forms. so i want create a custom control which binds the collection to the combo box? how t do it by

i need to bind a collection of objects to a combo box which i can use开发者_如何转开发 in different forms. so i want create a custom control which binds the collection to the combo box? how t do it by extending combo box? also how can i define the ItemData template?


Why do you want to extend ComboBox? You can directly bind ComboBox to a collection using ItemsSource property! This and this page explains more about data binding and using ItemTemplate with ComboBox. Or, you can explore more on MSDN.

0

精彩评论

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