DisplayColumnAttribute Constructors

Definition

Initializes a new instance of the DisplayColumnAttribute class.

Overloads

DisplayColumnAttribute(String)

Initializes a new instance of the DisplayColumnAttribute class by using the specified column.

DisplayColumnAttribute(String, String)

Initializes a new instance of the DisplayColumnAttribute class by using the specified display and sort columns.

DisplayColumnAttribute(String, String, Boolean)

Initializes a new instance of the DisplayColumnAttribute class by using the specified display column, and the specified sort column and sort order.

DisplayColumnAttribute(String)

Source:
DisplayColumnAttribute.cs
Source:
DisplayColumnAttribute.cs
Source:
DisplayColumnAttribute.cs

Initializes a new instance of the DisplayColumnAttribute class by using the specified column.

C#
public DisplayColumnAttribute(string displayColumn);

Parameters

displayColumn
String

The name of the column to use as the display column.

Examples

The following example shows how to define the parent column to display in a page for the child table as the foreign-key column.

C#
[DisplayColumn("LastName")]
public partial class Customer
{
}

Applies to

.NET 10 an aner Versiounen
Produkt Versiounen
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

DisplayColumnAttribute(String, String)

Source:
DisplayColumnAttribute.cs
Source:
DisplayColumnAttribute.cs
Source:
DisplayColumnAttribute.cs

Initializes a new instance of the DisplayColumnAttribute class by using the specified display and sort columns.

C#
public DisplayColumnAttribute(string displayColumn, string sortColumn);
C#
public DisplayColumnAttribute(string displayColumn, string? sortColumn);

Parameters

displayColumn
String

The name of the column to use as the display column.

sortColumn
String

The name of the column to use for sorting.

Remarks

By default, the column specified in sortColumn will be sorted in ascending order.

Applies to

.NET 10 an aner Versiounen
Produkt Versiounen
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

DisplayColumnAttribute(String, String, Boolean)

Source:
DisplayColumnAttribute.cs
Source:
DisplayColumnAttribute.cs
Source:
DisplayColumnAttribute.cs

Initializes a new instance of the DisplayColumnAttribute class by using the specified display column, and the specified sort column and sort order.

C#
public DisplayColumnAttribute(string displayColumn, string sortColumn, bool sortDescending);
C#
public DisplayColumnAttribute(string displayColumn, string? sortColumn, bool sortDescending);

Parameters

displayColumn
String

The name of the column to use as the display column.

sortColumn
String

The name of the column to use for sorting.

sortDescending
Boolean

true to sort in descending order; otherwise, false. The default is false.

Examples

The following example shows how to define the parent column to display in a page for the child table as the foreign-key column. It sets the parent table column for sorting and also sets the sort order.

C#
[DisplayColumn("City", "PostalCode", false)]
public partial class Address
{
}

Applies to

.NET 10 an aner Versiounen
Produkt Versiounen
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0