Telerik UI for Windows Phone by Progress

RadDataForm supports various other attributes which allow further customization of how editors are populated and their behavior.

Attributes supported by RadDataForm

  • IgnoreAttribute - omits the creation of an editor for the property on which it is defined in case the EditorCreationMode property of the form is set to CreateByDefault.
  • FormFieldAttribute - instructs RadDataForm to create an editor for the property on which it is defined in case the EditorCreationMode property of the form is set to IgnoreByDefault.
  • PasswordAttribute - used for string properties only. Instructs RadDataForm to create a RadPasswordBox based editor for the property.
  • ValidatorAttribute - used to define a validator for the property.
  • BooleanEditorTypeAttribute - used to define the type of the editor for a boolean property. There are two supported types currently - RadToggleSwitch or a CheckBox.
  • DateTimeEditorTypeAttribute - used to define the editor type for a DateTime property.
  • ValueRangeAttribute - used to define a value range for the editor for the corresponding property. Not all property types support this. Supported types are DateTime, TimeSpan, Numeric.

Using the RetrievingAttribute event

RadDataForm exposes the RetrievingAttribute event which is fire each time a property attribute retrieval is attempted for a given property. You can use this event to provide any type of attribute for the corresponding property in case defining it on the CLR property is not possible. The following code snippet demonstrates how the FieldInfoAttribute is defined for a property via the RetrievingAttribute event:

CopyC#
private void radDataForm_RetrievingAttribute_1(object sender, RetrievingAttributeEventArgs e)
{
    if (e.PropertyName == "SecondName" && e.AttributeType == typeof(FieldInfoAttribute))
    {
        e.Attribute = new FieldInfoAttribute() { FieldHeader = "Second name" };
    }
}