DisplayAttribute.AutoGenerateFilter Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a value that indicates whether filtering is automatically displayed for this field.

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

Syntax

'Declaration
Public Property AutoGenerateFilter As Boolean
public bool AutoGenerateFilter { get; set; }

Property Value

Type: System.Boolean
true if filtering is automatically displayed; otherwise, false.

Exceptions

Exception Condition
InvalidOperationException

The property does not contain a value when trying to retrieve the value.

Remarks

You set the AutoGenerateFilter property to explicitly override the default behavior of the presentation layer. For example, if a control automatically generates user-interface elements that include filtering capabilities, you can use this property to disable filtering for particular fields.

Use the GetAutoGenerateFilter method to retrieve the value of the AutoGenerateFilter property. The GetAutoGenerateFilter method returns nulla null reference (Nothing in Visual Basic) if the AutoGenerateFilter property has not been set, but the get accessor of the AutoGenerateFilter property throws an exception if the property is not set.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.