Sets a specific property identifier for user-defined classes.
Namespace: Dapfor.Wpf.DataAssembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)
Syntax
C# |
---|
public sealed class FieldAttribute : Attribute |
Visual Basic |
---|
Public NotInheritable Class FieldAttribute Inherits Attribute |
Visual C++ |
---|
public ref class FieldAttribute sealed : public Attribute |
F# |
---|
[<SealedAttribute>] type FieldAttribute = class inherit Attribute end |
Remarks
This attribute enables to alter the property identifier used by the GridControl.
Copy | |
---|---|
public class Product { //Some fields private double price; private double lastPrice; //Property, which is accessed by the "LastPrice" identifier public double LastPrice { get { return lastPrice; } } //Property, which is accessed by the "CurrentPrice" identifier [Field("CurrentPrice")] public double Price { get { return price; } } } public void HowToUseFieldAttribute(GridControl grid) { //Initialize the header grid.Headers.Add(new Header()); grid.Headers[0].Add(new Column("LastPrice")); grid.Headers[0].Add(new Column("CurrentPrice")); //Add a product to the grid. grid.Rows.Add(new Product()); } |