Version

About xamComboEditor

The xamComboEditor™ control is an editor that is similar to the ComboBox control provided by the .NET Framework. Just like the .NET Framework ComboBox control, the xamComboEditor control can display a drop-down list from which your end users can select a single item. Along with the default functionality of a ComboBox control, xamComboEditor also inherits the functionality provided by the ValueEditor class. The biggest difference between the ComboBox control provided by the .Net Framework and xamComboEditor is the way in which you bind data to the control.

DataBinding

Unlike the ComboBox control provided by the .NET Framework, xamComboEditor exposes an ItemsProvider property that you can set to an instance of a ComboBoxItemsProvider object. The ComboBoxItemsProvider object exposes an Items and ItemsSource property that you can use just like any other Microsoft® Windows® Presentation Foundation ItemsControl.

Having a ComboBoxItemsProvider object that provides data binding functionality allows xamComboEditor to share a single instance of a ComboBoxItemsProvider object across multiple instances of xamComboEditor. This greatly reduces the overhead in situations where multiple instances of xamComboEditor will use the same data source. For example, if you use xamComboEditor as an editor of a Field in xamDataGrid™, a single ComboBoxItemsProvider object will be shared by all xamComboEditors controls within the Cells of a Field.

You can declare a new instance of a ComboBoxItemsProvider object within the opening and closing ItemsProvider property tags of xamComboEditor. You can also declare a new instance of a ComboBoxItemsProvider in a ResourceDictionary and set the ItemsProvider property of xamComboEditor to a markup extension that references this resource. If you have multiple xamComboEditors that use the same data source, you should declare an instance of the ComboBoxItemsProvider object as a Resource to reduce overhead.