Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridCustomizeDataRowEditorEventArgs.FieldName Property

Returns a name of the data field whose editor is being processed.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public string FieldName { get; }

#Property Value

Type Description
String

The data field’s name.

#Remarks

The following code snippet handles the CustomizeDataRowEditor event to customize the HireDate column editor in two ways:

  • Limit available hire dates for new employees.
  • Prohibit hire date modification for existing employees.
razor
<DxGrid Data="@employees" PageSize="4" ShowFilterRow="true"
        CustomizeDataRowEditor="OnCustomizeDataRowEditor" >
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="FirstName" />
        <DxGridDataColumn FieldName="LastName" />
        <DxGridDataColumn FieldName="BirthDate" />
        <DxGridDataColumn FieldName="HireDate" />
        <DxGridDataColumn FieldName="Email" />
    </Columns>
</DxGrid>

@code {
    Employee[]? employees;
    protected override async Task OnInitializedAsync() {
        employees = await EmployeeData.GetData();
    }
    void OnCustomizeDataRowEditor(GridCustomizeDataRowEditorEventArgs e) {
        if (e.FieldName == "HireDate") {
            var HireDateSettings = e.EditSettings as IDateEditSettings;
            if (e.IsNewRow) {
                // Limit the available hire date for new employees two weeks ahead.
                HireDateSettings.MinDate = @DateTime.Today;
                HireDateSettings.MaxDate = @DateTime.Today.AddDays(14);
            } else {
                // Disable the hire date editing.
                HireDateSettings.Enabled = false;
                HireDateSettings.ShowDropDownButton = false;
            }
        }
    }
}

Limited dates in the calendar editor

See Also