SPField members

Represents a field in a list on a SharePoint Foundation Web site.

The SPField type exposes the following members.

Constructors

  Name Description
Public method SPField(SPFieldCollection, String) Initializes a new instance of the SPField class based on the specified field collection object and field name.
Public method SPField(SPFieldCollection, String, String) Initializes a new instance of the SPField class based on the specified field collection object, field type, and field name.

Top

Properties

  Name Description
Public property AggregationFunction Gets or sets the aggregation function for the field.
Public property AllowDeletion Gets or sets a Boolean value that specifies whether the field can be deleted.
Public property AuthoringInfo Gets the descriptive string that is used in pages for editing fields to identify the field and its purpose.
Public property CalloutMenu Gets or sets an indication of whether the field shows a link to the callout menu.
Public property CalloutMenuAllowed Gets or sets an indication of whether showing the callout menu in the field is allowed, prohibited, or is optional and determined by the CalloutMenu property.
Public property CanBeDeleted Gets a Boolean value that indicates whether the field can be deleted.
Public property CanBeDisplayedInEditForm A read-only property indicating whether or not the field can be displayed in an edit form.
Public property CanToggleHidden Gets a Boolean value that indicates whether the column can be hidden through the user interface.
Public property CompositeIndexable Indicates whether and in what capacity the field can participate in a composite index.
Public property DefaultFormula Gets or sets the default formula for a calculated field.
Public property DefaultListField Gets a value that indicates whether to show the properties form of a file when it is uploaded to a document library.
Public property DefaultValue Gets or sets the default value for a field.
Public property DefaultValueTyped Gets the default value object based on the field type.
Public property Description Gets or sets the description for a field.
Public property DescriptionResource Gets an SPUserResource object that represents the translations for the description of the field.
Public property Direction Gets or sets the direction of the reading order for the field.
Public property DisplaySize Gets or sets the display size for the field.
Public property EnforceUniqueValues Gets or sets a Boolean value that specifies whether to enforce uniqueness in column values. The default is false.
Public property EntityPropertyName Gets the name of the entity property for the list item entity that uses this field.
Public property FieldReferences Gets a string array that contains the internal names of fields that are referenced in a computed field.
Public property FieldRenderingControl Gets the field type control that is used to render the field in Display, Edit, and New forms, as well as in data form Web Parts or pages that use field controls.
Public property FieldRenderingMobileControl Obsolete. Deprecated. Use the FieldRenderingMobileWebControl property instead. Gets the mobile field type control that is used to render the field in Display, Edit, and New forms, data form Web Parts, or any pages that use field controls in mobile applications.
Public property FieldRenderingMobileWebControl When implemented in a derived class, gets the mobile field type control that is used to render the field in Display, Edit, and New forms, data form Web Parts, or any pages that use field controls.
Public property FieldTypeDefinition Gets an SPFieldTypeDefinition object that represents the field type definition for the field.
Public property FieldValueType Gets the value type of the field when the field type has its own value type.
Public property Filterable Gets a Boolean value that indicates whether the field can be filtered.
Public property FilterableNoRecurrence Gets a Boolean value that indicates whether a filter can be created on a field in a view that does not expand recurring events.
Public property FromBaseType Gets a Boolean value that indicates whether the field derives from a base field type.
Public property Group Gets or sets the column group to which the field belongs.
Public property Hidden Gets or sets a Boolean value that specifies whether the field is displayed in the list.
Public property Id Gets the GUID of the field.
Public property IMEMode Gets or sets the Input Method Editor (IME) mode bias to use for the field. The IME enables conversion of keystrokes between languages when one writing system has more characters than can be encoded for the given keyboard.
Public property Indexable Read-only property indicating whether the field can be indexed or not.
Public property Indexed Gets or sets a Boolean value that specifies whether the field is indexed.
Public property InternalName Gets the internal name that is used for the field.
Public property JSLink When implemented in a derived class, gets or sets the name of an external JavaScript file (or set of files separated by the "|" character) that contains any client rendering logic for fields of the derived type.
Public property JumpToField Gets the name of a field that represents the next question to which users are taken in a survey, which is dependent on the answer they give to the current question.
Public property LinkToItem Gets or sets an indication of whether the field should show a link to the list item's display form when displayed in a list view.
Public property LinkToItemAllowed Gets or sets an indication of whether the field, in List View, can show a link to the list item's display form.
Public property ListItemMenu Gets or sets an indication of whether the field should show a link to the list item's drop down menu when displayed in a list view.
Public property ListItemMenuAllowed Gets or sets an indication of whether the field, in List View, can show a link to the list item's drop down menu.
Public property NoCrawl Gets or sets a Boolean value that specifies whether the field can be crawled by a search engine.
Public property ParentList Gets the parent list that contains the field.
Public property PIAttribute Gets or sets the attribute in the document processing instruction (specified by the PITarget property) that is used as the column value for property promotion and demotion in XML documents.
Public property PITarget Gets or sets the document processing instruction in which the column value is stored in documents of the specified content type, which is used for property promotion and demotion in XML documents.
Public property PreviewValueTyped Gets a preview value of field data for a design-time view of the field control in Display and Edit modes when there is no list item data associated with the field.
Public property PrimaryPIAttribute Gets or sets an alternate attribute in the document processing instruction, specified by the PrimaryPITarget property, that is used as the column value in property promotion and demotion in XML documents.
Public property PrimaryPITarget Gets or sets an alternative document processing instruction in which the column value is stored for documents of the specified content type.
Public property PushChangesToLists Gets or sets a Boolean value that specifies whether to propagate changes that are made in the field template to lists that implement the field.
Public property ReadOnlyField Gets or sets a Boolean value that specifies whether values in the field can be modified.
Public property RelatedField Gets or sets the internal name of a field to which the current field is related.
Public property Reorderable Gets a Boolean value that indicates whether values in the field can be reordered.
Public property Required Gets or sets a Boolean value that determines whether users must enter a value for the field on New and Edit forms.
Public property SchemaXml Gets or sets the schema that defines the field.
Public property SchemaXmlWithResourceTokens Gets the schema that defines the field and includes resource tokens.
Public property Scope Gets the Web site-relative path to the list in which the field collection is used.
Public property Sealed Gets a value that indicates whether Microsoft SharePoint Foundation field type (as specified in the Type property) can be the parent of a custom derived field type.
Public property ShowInDisplayForm Gets or sets a Boolean value that specifies whether the field is displayed in the form for displaying list items.
Public property ShowInEditForm Gets or sets a Boolean value that specifies whether the field is displayed in the form that is used to edit list items.
Public property ShowInListSettings Gets or sets a Boolean value that specifies whether the field is displayed in the page for customizing list settings.
Public property ShowInNewForm Gets or sets a Boolean value that specifies whether the field is displayed in the form that is used to create list items.
Public property ShowInVersionHistory Gets or sets a Boolean value that specifies whether the field is displayed in the page for viewing list item versions.
Public property ShowInViewForms Gets or sets a Boolean value that specifies whether the field is displayed in pages that are used to view list data.
Public property Sortable Gets a Boolean value that determines whether the field can be sorted.
Public property SourceId Gets either the namespace that defines a built-in field or, if it a custom field, the GUID that identifies the list or Web site where it was created.
Public property StaticName Gets or sets a static name for the field.
Public property Title Gets or sets the display name for the field.
Public property TitleResource Gets the resource object associated with the field’s display name.
Public property TranslationXml Document content that has been stored in a multilingual database for display as an XML document.
Public property Type Gets or sets the type of the field.
Public property TypeAsString Gets the type of the field as a string value.
Public property TypeDisplayName Gets the display name of the field type.
Public property TypeShortDescription Gets the description of the field.
Public property UsedInWebContentTypes Gets a Boolean value that indicates whether the field is implemented in any content type that is used in the site collection.
Public property ValidationEcmaScript Gets an ECMAScript function that corresponds to the field’s validation formula.
Public property ValidationFormula Indicates the formula referenced by the field and is evaluated when a list item is added or updated.
Public property ValidationMessage Gets or sets a message to display to the user if validation fails for this field.
Public property Version Gets the version of the field.
Public property XPath Gets or sets the XPath expression to the field.

Top

Methods

  Name Description
Public method AnnotateField When overridden in a derived class, adds attributes to the specified XML node and assigns them values from the properties of this SPField object.
Public method Delete Deletes the field.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetCustomProperty Gets the value of custom property with the specified name.
Public method GetFieldValue Converts the specified value into a field type value.
Public method GetFieldValueAsHtml Gets the field value in HTML format in order to render the field value directly on the page.
Public method GetFieldValueAsText Gets the field value as plain text.
Public method GetFieldValueForClientRender When overridden in a derived class, converts the field type value into object for use in client Display, Edit and New item forms.
Public method GetFieldValueForEdit Gets the field value that is rendered in Edit mode in Edit and New forms.
Public method GetHashCode (Inherited from Object.)
Public method GetJsonClientFormFieldSchema When overridden in a derived class, gets an object containing information from the field's schema that is useful for client rendering of the field in forms.
Public method GetProperty Gets the value of the specified property.
Public method GetType (Inherited from Object.)
Public method GetValidatedString Validates and converts the field value into a serialized form.
Protected method HasValue Internal function used to verify whether an object is null or not.
Public method ListsFieldUsedIn Returns information about the Web sites and lists in which the current field is used.
Protected method MemberwiseClone (Inherited from Object.)
Public method OnAdded Handles the event that occurs after a field is added.
Public method OnAddingToContentType Handles the event that occurs when a field is added to a specified content type.
Public method OnDeleting Handles the event that occurs when a field is being deleted.
Public method OnDeletingFromContentType Handles the event that occurs when a field is deleted from a specified content type.
Protected method OnInitFieldNode This member is reserved for internal use and is not intended to be used directly from your code.
Public method OnUpdated Handles the event that occurs after changes are made to a field.
Public method ParseAndSetValue When overridden in a derived class, sets the specified field item to the specified value.
Public method ParseValue When overridden in a derived class, parses a potential value of the field and returns an object that can be assigned as the value of the field.
Public method RenderFieldValueAsJson When overridden in a derived class, returns the specified value in JSON format.
Public method RevertCustomizations Reverts customizations made to the field schema.
Public method SetCustomProperty Sets a value for the specified property.
Public method ToString Returns the title of the field. (Overrides Object.ToString().)
Public method Update() Updates the database with changes that are made to the field.
Public method Update(Boolean) Updates the database with changes that are made to the field and optionally propagates the changes to lists that implement the field.
Public method ValidateAndParseValue When overridden in a derived class, validates and parses the input value and returns a valid object that can be the value of the field.
Public method ValidateParseAndSetValue Calls ValidateAndParseValue(SPListItem, String) and assigns the returned object as the value of the field.

Top

See also

Reference

SPField class

Microsoft.SharePoint namespace