Skip to main content

ValueEditContext.OnChanged(Object) Method

A delegate method that handles changes in a custom editor.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor


public void OnChanged(
    object value


Name Type Description
value Object

A new editor value.


When you use a Form Layout item’s Template, the component is not notified when a user changes data within an item’s custom editor. To inform the Form Layout about the change, call the OnChanged method when a custom editor’s value is changed.

<DxFormLayout Data="@editFormData"
              ItemUpdating="@((pair) => OnItemUpdating(pair.Key, pair.Value))">
    @* ... *@
    <DxFormLayoutItem Field="@nameof(FormDataItem.Position)" Caption="Position:" ColSpanMd="6">
            <DxComboBox Data="@(new List<string>() { "Sales Representative", "Designer" })"
                        ValueChanged="@((string value) => ((ValueEditContext)context).OnChanged(value))">

@code {
    FormDataItem editFormData = new FormDataItem() {
        Name = "Nancy Davolio",
        BirthDate = DateTime.Now.AddYears(-30),
        YearsWorked = 3,
        Position = "Sales Representative"

    void OnItemUpdating(string fieldName, object newValue) {
        if (fieldName == nameof(FormDataItem.Name)) {
            editFormData.Name = newValue.ToString();
        } else if (fieldName == nameof(FormDataItem.BirthDate)) {
            editFormData.BirthDate = (DateTime)newValue;
        } else if (fieldName == nameof(FormDataItem.YearsWorked)) {
            editFormData.YearsWorked = (int)newValue;
        } else if (fieldName == nameof(FormDataItem.Position)) {
            editFormData.Position = newValue.ToString();

Form Layout - A value edit context

Run Demo: Form Layout - Bind to Data

See Also