maui-devexpress-dot-maui-dot-collectionview-dot-dxcollectionview-268ed80b.md
Gets or sets the pattern used to format list items. This is a bindable property.
Namespace : DevExpress.Maui.CollectionView
Assembly : DevExpress.Maui.CollectionView.dll
NuGet Package : DevExpress.Maui.CollectionView
public string DisplayFormat { get; set; }
| Type | Description |
|---|---|
| String |
The pattern used to format the CollectionView’s items.
|
Use the DisplayFormat property to format the CollectionView item’s display value and add additional text. The pattern should have the following structure:
<custom static text>{0:<format specifier<precision specifier>>}<custom static text>
For example, set the DisplayFormat property to Price: {0:c2} to display currency values. If the summary value is 123 , its formatted equivalent is Price: $123.00.
Refer to the following pages for more information about format specifiers:
The following example formats a CollectionView’s items:
<dxcv:DXCollectionView ItemsSource="{Binding Data}"
DisplayMember="Name"
DisplayFormat="Contact: {0}">
</dxcv:DXCollectionView>
In XAML, insert empty brackets into the beginning of a format string if it starts with a placeholder. Refer to the following page for more information: {} Escape sequence / markup extension.
You can also define the DXCollectionView.ItemTemplate property to format and customize the CollectionView item’s content.
See Also