Enables use of standard string patterns to format values in cells.

Namespace: Dapfor.Net.Formats
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public class FormatAttribute : FormatBaseAttribute
Visual Basic
Public Class FormatAttribute
	Inherits FormatBaseAttribute
Visual C++
public ref class FormatAttribute : public FormatBaseAttribute
F#
type FormatAttribute =  
    class
        inherit FormatBaseAttribute
    end

Remarks

Some formats greatly simplify application development. For example, StringFormat enables use of standard patterns for formatting values through String.Format():

 Copy imageCopy
column.Format = new StringFormat("### ### ### ###", string.Empty, " $");
The value 12345 is displayed as "12 345 $"

The following example demonstrates how to declare string pattern for a class property:

 Copy imageCopy
public class Product
{
    private DateTime maturity;

    [Format("yyyy-MM-dd")]
    public DateTime Maturity
    {
        get { return maturity; }
    }
}

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    Dapfor.Net.Formats..::..FormatBaseAttribute
      Dapfor.Net.Formats..::..FormatAttribute

See Also