Skip to content

Commit 076bf7f

Browse files
committed
Sample(GH-3725): AutoGenerate columns sample in server and wasm
1 parent dea9a7a commit 076bf7f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

DataAnnotation_Server/Pages/Index.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@
3535
//Specifies whether the property this attribute is bound to be read only.
3636
[ReadOnly(true)]
3737
//Sets the header text to the column.
38-
[Display(Name = "Customer Name", Order = 1)]
38+
[Display(Name = "Customer Name", Order = 2)]
3939
public string? Name { get; set; }
4040

4141
//Gets or sets whether UI should be generated automatically to display this field
4242
[Display(AutoGenerateField = false)]
4343
public int? CustomerID { get; set; }
4444

4545
//Gets or sets the order in which this field should be displayed
46-
[Display(Order = 4)]
46+
[Display(Order = 1)]
4747
public string? ShipCity { get; set; }
4848

49-
[Display(Order = 3)]
49+
[Display(Order = 4)]
5050
//Specifies how data fields are displayed and formatted by ASP.NET dynamic data
5151
[DisplayFormat(DataFormatString = "c2")]
5252
public float Freight { get; set; }
5353

54-
[Display(Order = 2)]
54+
[Display(Order = 3)]
5555
public DateTime? OrderDate { get; set; }
5656
}
5757
}

DataAnnotation_Wasm/Pages/Index.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@
3535
//Specifies whether the property this attribute is bound to be read only.
3636
[ReadOnly(true)]
3737
//Sets the header text to the column.
38-
[Display(Name = "Customer Name", Order = 1)]
38+
[Display(Name = "Customer Name", Order = 2)]
3939
public string? Name { get; set; }
4040

4141
//Gets or sets whether UI should be generated automatically to display this field
4242
[Display(AutoGenerateField = false)]
4343
public int? CustomerID { get; set; }
4444

4545
//Gets or sets the order in which this field should be displayed
46-
[Display(Order = 4)]
46+
[Display(Order = 1)]
4747
public string? ShipCity { get; set; }
4848

49-
[Display(Order = 3)]
49+
[Display(Order = 4)]
5050
//Specifies how data fields are displayed and formatted by ASP.NET dynamic data
5151
[DisplayFormat(DataFormatString = "c2")]
5252
public float Freight { get; set; }
5353

54-
[Display(Order = 2)]
54+
[Display(Order = 3)]
5555
public DateTime? OrderDate { get; set; }
5656
}
5757
}

0 commit comments

Comments
 (0)