Back to Devexpress

DxButtonEditSettings.DisplayFormat Property

blazor-devexpress-dot-blazor-dot-dxbuttoneditsettings.md

latest2.9 KB
Original Source

DxButtonEditSettings.DisplayFormat Property

Specifies the pattern used to format unfocused editor values.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDefaultDescription
Stringnull

The format pattern.

|

Remarks

You can specify a display format at column and editor levels:

  • A column’s DisplayFormat property formats column cell values when the Grid or TreeList is in display mode.
  • An editor’s DisplayFormat property formats the value of the editor when it is unfocused and the Grid or TreeList is in edit mode.

When one of these properties is unspecified, the specified property defines both formats.

Refer to the following topics for additional information about supported format strings:

The following example applies the long date format in display mode and the short date format in edit mode:

razor
<DxGrid Data="@employees" PageSize="6" EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="FirstName" />
        <DxGridDataColumn FieldName="LastName" />
        <DxGridDataColumn FieldName="HireDate" >
             <EditSettings>
                <DxDateEditSettings DisplayFormat="D" Format="d" />
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="Email" />
    </Columns></DxGrid>

@code {
    Employee[]? employees;

    protected override async Task OnInitializedAsync() {
        employees = await EmployeeData.GetData();
    }
}

To change how unfocused editor values are formatted at runtime, use the IButtonEditSettings.DisplayFormat property.

Implements

DisplayFormat

See Also

DxButtonEditSettings Class

DxButtonEditSettings Members

DevExpress.Blazor Namespace