# Column Display Format

You can set a C# format string to the column so that it renders the values with the corresponding styling according to the current culture of the thread.

## Basics

To set the desired format string, use the `DisplayFormat` parameter of the column.

If the model field has the `DataFormatString` set through the `DisplayFormat` DataAnnotation attribute, the grid will honor that without an explicit setting in the markup of the column.

You can use the standard C# formatting options, because the grid uses a `string.Format` call: <a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/formatting-types" target="_blank">MSDN: Format types in .NET</a>.

## Example

> caption Use C# format strings in the treelist through the component markup and a data annotation attribute in the model

<demo metaUrl="client/treelist/columns/display-format/example-1/" height="720"></demo>

## Notes

* Numeric, DateTime and Enum types can use such formats. String and Boolean types are displayed without such a format, however.

* The `CultureInfo.CurrentCulture` is used when rendering the formats, so if you need specific formats for specific users, you must set the culture of the app accordingly.

* The `DisplayFormat` parameter defines the format that is used to render Numeric or DateTime values when the component initializes. As it is not applied in edit mode, the editor will display the default format of the field depending on the culture. In order to customize the format when editing, together with setting the `DisplayFormat` parameter, you can use Editor Template for [Grid](https://www.telerik.com/blazor-ui/documentation/components/grid/templates/editor) or [TreeList](https://www.telerik.com/blazor-ui/documentation/components/treelist/templates/editor).

## See Also

* [Live Demo: Cell Formatting](https://demos.telerik.com/blazor-ui/treelist/cell-formatting)
