Version

About xamDataPresenter and xamEditors

The xamEditor controls are automatically registered to edit a specific data type in a xamDataPresenter™ control’s Field. For example, xamCheckEditor™ is registered to edit a Field with a Boolean data type while xamCurrencyEditor™ is registered to edit a Field with a decimal data type. Using this information, you can easily embed a xamEditor control in an unbound field by setting the Field object’s DataType property. For example, if you want to add a field of xamCheckEditor controls to xamDataPresenter, xamDataCarousel™, or xamDataGrid™, you can add a Field object to a field layout and set its BindingType property to Unbound and its DataType property to Boolean.

If you want to change the default registration of a xamEditor and a data type, you can manually register a xamEditor control for a specific data type by calling the static RegisterDefaultEditorForType method of the ValueEditor class. Calling this method before or during xamDataPresenter’s FieldLayoutInitialized event will change the xamEditor control that xamDataPresenter uses to edit a specific data type. For a list of xamEditors and their registered data types, see Default Editor Types for Different Data Types.

If you use the RegisterDefaultEditorForType method to change the xamEditor control registered to a specific data type, all fields with that data type will use the same xamEditor control. However, you also have granular control over the xamEditor control for individual fields in a field layout. The FieldSettings object exposes the EditorType property so that you can change the xamEditor control that a field uses to edit data. If you need to set properties of the xamEditor control, you have to create a Style that targets that particular xamEditor.