DisplayAttribute.AutoGenerateField Property
Silverlight
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)
Property Value
Type: System.Booleantrue if the field is automatically displayed in the user interface; otherwise, false.
| Exception | Condition |
|---|---|
| InvalidOperationException | 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.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.