Xceed Grid for WinForms v4.3 Documentation
Xceed.Grid.v4.3 Assembly / Xceed.Grid Namespace / Cell Class / FormatSpecifier Property
Example


In This Topic
    FormatSpecifier Property (Cell)
    In This Topic
    Gets or sets the format that will be used to display the cell's content.
    Syntax
    'Declaration
     
    <CategoryAttribute("Appearance")>
    <DescriptionAttribute("The format that will be used to display cell's content.")>
    <TypeConverterAttribute("Xceed.Grid.Design.FormatSpecifierConverter,Xceed.Grid.v4.3.Design,Version=4.3.25208.5768,Culture=neutral,PublicKeyToken=ba83ff368b7563c6")>
    <AmbientValueAttribute("")>
    <LocalizableAttribute(True)>
    <ApplyToDesignerAttribute(False)>
    Public Property FormatSpecifier As String
    'Usage
     
    Dim instance As Cell
    Dim value As String
     
    instance.FormatSpecifier = value
     
    value = instance.FormatSpecifier
    [Category("Appearance")]
    [Description("The format that will be used to display cell's content.")]
    [TypeConverter("Xceed.Grid.Design.FormatSpecifierConverter,Xceed.Grid.v4.3.Design,Version=4.3.25208.5768,Culture=neutral,PublicKeyToken=ba83ff368b7563c6")]
    [AmbientValue("")]
    [Localizable(true)]
    [ApplyToDesigner(false)]
    public string FormatSpecifier {get; set;}

    Property Value

    A string representing the format that will be used to display the cell's content.
    Remarks

    The list of values that can be passed to the FormatSpecifier property can be found in the "Format Specifiers and Format Providers" topic of the .NET Framework.

    If the IsFormatSpecifierAmbient property returns true, then the value of the FormatSpecifier property is inherited from its parent.

    To reset the value of the FormatSpecifier property to its default value, DefaultFormatSpecifier, the ResetFormatSpecifier method must be called or the FormatSpecifier property set to a null reference (Nothing in Visual Basic).

    Example
    The following examples demonstrate how to set the FormatSpecifier property.
    ' Short date gridControl1.DataRowTemplate.Cells( "Date1" ).FormatSpecifier = "d" ' Long date gridControl1.DataRowTemplate.Cells( "Date2" ).FormatSpecifier = "D" ' Currency gridControl1.DataRowTemplate.Cells( "Amount" ).FormatSpecifier = "c"
    // Short date gridControl1.DataRowTemplate.Cells[ "Date1" ].FormatSpecifier = "d"; // Long date gridControl1.DataRowTemplate.Cells[ "Date2" ].FormatSpecifier = "D"; // Currency gridControl1.DataRowTemplate.Cells[ "Amount" ].FormatSpecifier = "c";
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also