ListFieldIterator.IsFieldExcluded method

Gets a value that indicates whether the specified field is excluded when the ListFieldIterator is rendered.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

protected virtual bool IsFieldExcluded(
	SPField field


Type: Microsoft.SharePoint.SPField

The field whose exclusionary status is reported.

Return value

Type: System.Boolean
true if the field is not rendered; otherwise, false.

In the default implementation, if either field.InternalName or field.Title is listed in ExcludeFields, IsFieldExcluded returns true.

Caution noteCaution

Because a field is excluded if either its InternalName or Title is included in ExcludeFields, when you create custom fields, you should not only keep each Title unique and each Internal Name unique; you should also ensure that no Title is the same as any other field's Internal Name. Otherwise, you might exclude two fields when you want to exclude only one.

Even if field is not listed in ExcludeFields, the default implementation of IsFieldExcluded returns true in certain circumstances when it would be undesirable to render the field. For example, if the field appears somewhere else on the page anyway, it is not be rendered by the ListFieldIterator. Some of the other factors that the method takes into account are in the following list.