DisplayAttribute.AutoGenerateField Property

Gets or sets a value that indicates whether the field is automatically displayed in the user interface.

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


Public Property AutoGenerateField As Boolean
public bool AutoGenerateField { get; set; }

Property Value

Type: System.Boolean
true if the field is automatically displayed in the user interface; otherwise, false.


Exception Condition

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


You set the AutoGenerateField property to explicitly override the default behavior of the presentation layer.

Use the GetAutoGenerateField method to retrieve the value of the AutoGenerateField property. The GetAutoGenerateField method will return nulla null reference (Nothing in Visual Basic) if the AutoGenerateField property has not been set, but the get accessor of the AutoGenerateField property will throw an exception if the property is not set.

Version Information


Supported in: 5, 4, 3


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