Back to Devexpress

TreeListColumn.Format Property

windowsforms-devexpress-dot-xtratreelist-dot-columns-dot-treelistcolumn-7138875a.md

latest2.8 KB
Original Source

TreeListColumn.Format Property

Gets the object that specifies the formatting applied to column values.

Namespace : DevExpress.XtraTreeList.Columns

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[XtraSerializableProperty(XtraSerializationVisibility.Content)]
public FormatInfo Format { get; }
vb
<XtraSerializableProperty(XtraSerializationVisibility.Content)>
Public ReadOnly Property Format As FormatInfo

Property Value

TypeDescription
FormatInfo

A FormatInfo object that specifies formatting settings for column values.

|

Remarks

Settings provided by this property allow you to specify the type of formatted values and the applied format string. You can also implement formatting of any complexity by providing a custom formatter object.

Please refer to the Formatting Cell Values topic for more information.

Example

The following example shows how to use the standard format specifiers in a column that displays numeric values. The column’s format string is set to “c2”. This indicates that a value will be formatted as a currency amount with two digits to the right of the decimal point.

The following image shows the result:

For information on format specifiers, refer to the Format Specifiers topic.

csharp
treeList1.Columns["Currency"].Format.FormatType = DevExpress.Utils.FormatType.Numeric;
treeList1.Columns["Currency"].Format.FormatString = "c2";
vb
treeList1.Columns("Currency").Format.FormatType = DevExpress.Utils.FormatType.Numeric
treeList1.Columns("Currency").Format.FormatString = "c2"

See Also

Formatting Cell Values

TreeListColumn Class

TreeListColumn Members

DevExpress.XtraTreeList.Columns Namespace