Back to Devexpress

DxSearchBox.DisplayFormat Property

blazor-devexpress-dot-blazor-dot-dxsearchbox-7d0fcd0f.md

latest2.1 KB
Original Source

DxSearchBox.DisplayFormat Property

Specifies the pattern used to format the Search Box’s display value when the editor is not focused.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue("")]
[Parameter]
public string DisplayFormat { get; set; }

Property Value

TypeDefaultDescription
StringString.Empty

The format pattern.

|

Remarks

Use the DisplayFormat property to format the Search Box’s display value when the editor is not focused. The specified format is applied when the Search Box’s edit value (the Text property value) can be converted to a numeric or DateTime data type. See the Format strings and .NET types documentation section for additional information.

The following example applies the currency format to numeric edit values:

razor
<DxSearchBox @bind-Text="@Value"
             DisplayFormat="C"
             aria-label="Search" />

<p class="cw-320 mt-3">
    Search text: <b>@Value</b>
</p>

@code {
    string Value { get; set; } = "25.5";
}

See Also

DxSearchBox Class

DxSearchBox Members

DevExpress.Blazor Namespace