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)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Protected Overridable Function IsFieldExcluded ( _
    field As SPField _
) As Boolean
'Usage
Dim field As SPField
Dim returnValue As Boolean

returnValue = Me.IsFieldExcluded(field)
protected virtual bool IsFieldExcluded(
    SPField field
)

Parameters

Return Value

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

Remarks

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

Warning

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.

See Also

Reference

ListFieldIterator Class

ListFieldIterator Members

Microsoft.SharePoint.WebControls Namespace