Glossary Item Box
The xamDataPresenter™ control can use any NetAdvantage for WPF editor to display a Field's content. These editors all derive from the ValueEditor class. The EditorType property off the FieldSettings only accepts editors that derive from the ValueEditors class. When you set the EditorType property, you can also set the EditAsType property. The EditAsType property informs xamDataPresenter what type of validation to do when a customer is editing a value in a Cell. This property is crucial if your data source doesn't have types specified for Fields. If your data source doesn't set the type, xamDataPresenter won't validate data because all values will be treated as type object. Therefore, if xamDataPresenter knows what type a Field should be, it will perform basic type validation.
Using the EditorType and EditAsType properties together ensures that data validation is performed on data input. This topic explains how to expand a Field to use the FieldSettings object. This topic also assumes you have completed one of the three following topics:
These topics show you how to access xamDataPresenter's Field and FieldLayouts in XAML. Since we are setting the FieldSettings off the Field, you will need to have access to the xamDataPresenter's FieldLayouts.
In XAML:
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:igEditors="http://infragistics.com/Editors"
In XAML:
...
<igDP:Field Name="ProductName" >
<igDP:Field.Settings>
<igDP:FieldSettings EditAsType="{x:Type sys:String}"
EditorType="{x:Type igEditors:XamTextEditor}"/>
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="CostPerUnit" />
<igDP:Field Name="Quantity" >
<igDP:Field.Settings>
<igDP:FieldSettings EditAsType="{x:Type sys:Int32}"
EditorType="{x:Type igEditors:XamNumericEditor}"/>
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="Discount" >
<igDP:Field.Settings>
<igDP:FieldSettings EditAsType="{x:Type sys:Int32}"
EditorType="{x:Type igEditors:XamNumericEditor}"/>
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="ShipAndHandle"/>
...