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 bool AutoGenerateField { get; set; }

Property Value

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


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 null 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.


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.

Community Additions