Default Element (Field Types Property Schema)

Applies to: SharePoint Foundation 2010


This topic describes markup that was used in an obsolete method of rendering custom field type properties. It is provided solely to assist with the debugging of custom field type properties developed against earlier versions of SharePoint Foundation. For information about the recommended method, Custom Field Type Property Rendering.

Represents the default value of a property of a custom field type.




Child Elements


Parent Elements

Field Element (Field Types)


See PropertySchema Element (Field Types) for a description of this element in context.


The following example defines a property schema for a custom field type called "RegularExpressionMatch." The schema declares a field that can be used by column creators when they create a column based on the field type. The purpose of the field is to enable a column creator to set a different regular expression for each column that is based on the RegularExpressionMatch field type.

The DisplayName and an editable Text field appear in the Additional Column Settings section on the New Site Column page and the Create Column page. The MaxLength attribute sets the maximum length, in characters, of the regular expression, and DisplaySize sets the size of the field that holds the MaxLength attribute. Users can scroll within the field to see the rest of the regular expression if it is longer than what appears in the DisplaySize field.

In the code example below, the Default element for the property is


because this pattern matches American telephone numbers and in this example the developer knows that his field will most frequently be used to create columns that hold American telephone numbers. When users create a column that is based on a custom field type, and the New Site Column and Create Column pages initially open, this property value appears in a text box, where it can then be changed by the column creator. Note that the code example below has been edited for clarity.

  <Field Name="TypeName">RegularExpressionMatch</Field>
      <Field Name="RegularExpression" 
             DisplayName="Regular Expression To Match" 

See Also


Custom Field Types

How to: Create a Custom Field Class

Custom Field Type Property Rendering

How to: Create a Custom Field Type Definition