Skip to main content
All docs
V24.2

IButtonEditSettings.DisplayFormat Property

Specifies the pattern used to format unfocused editor values.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

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

Property Value

Type Default Description
String null

The format pattern.

Remarks

Use the DisplayFormat property to change how unfocused editor values are formatted at runtime. To specify the format in markup, use the DxButtonEditSettings.DisplayFormat property.

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

The IButtonEditSettings interface allows you to get and customize settings of editors that contain buttons. You can get editor settings in the following ways. Note that you can cast settings to the base IButtonEditSettings interface or to an editor-specific interface.

  • Call the GetColumnEditSettings method to get editor settings of the column bound to the specified data source field.

    Important

    You need to enclose your code between BeginUpdate and EndUpdate method calls to change values of Grid component parameters outside the Grid component markup. Otherwise, an exception occurs.

    var hireDateEditSettings = e.Grid.GetColumnEditSettings<IButtonEditSettings>("HireDate");
    // or var hireDateEditSettings = e.Grid.GetColumnEditSettings<IDateEditSettings>("HireDate");
    if(hireDateEditSettings != null) {
        e.Grid.BeginUpdate();
        hireDateEditSettings.DisplayFormat = "D";
        e.Grid.EndUpdate();
    }
    
  • Handle the CustomizeFilterRowEditor event to customize a cell editor in the filter row.
    void Grid_CustomizeFilterRowEditor(GridCustomizeFilterRowEditorEventArgs e) {
        if(e.EditSettings is IButtonEditSettings hireDateEditSettings)
        // or if(e.EditSettings is IDateEditSettings hireDateEditSettings)
            hireDateEditSettings.DisplayFormat = "D";
    }
    
  • Handle the CustomizeDataRowEditor event to customize a cell editor in a data row.
    void Grid_CustomizeDataRowEditor(GridCustomizeDataRowEditorEventArgs e) {
        if(e.EditSettings is IButtonEditSettings hireDateEditSettings)
        // or if(e.EditSettings is IDateEditSettings hireDateEditSettings)
            hireDateEditSettings.DisplayFormat = "D";
    }
    
See Also