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.
精彩评论