DisplayAttribute.GetOrder Method

Retrieves the value of the Order property.

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


Public Function GetOrder As Nullable(Of Integer)
public Nullable<int> GetOrder()

Return Value

Type: System.Nullable<Int32>
The value of the Order property if the property is set, or nulla null reference (Nothing in Visual Basic) if the property is not set.


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

When a value for the Order property is not specified, the presentation layer should use a value such as 10000. This value enables explicitly-ordered fields to be displayed before or after the fields that do not specify an order.

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.