Skip to main content
A newer version of this page is available. .

DxMaskedInput<T>.BindValueMode Property

Specifies how to update the Masked Input editor’s value when it is bound to a property/field.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(BindValueMode.OnLostFocus)]
[Parameter]
public BindValueMode BindValueMode { get; set; }

Property Value

Type Default Description
BindValueMode OnLostFocus

A BindValueMode enumeration value.

Available values:

Name Description
OnLostFocus

The editor value is updated after the editor loses focus.

OnInput

The editor value is updated whenever a user types.

OnDelayedInput

The editor value is updated with a delay after a user makes changes.

Remarks

The BindValueMode property only works if you bind the Masked Input editor’s Value to a field or a property.

If a user changes the input value, the editor updates its Value property. The BindValueMode property allows you to specify when the update happens.

OnLostFocus Mode

The default mode is OnLostFocus. The actual editor value is updated after a user changes the input value and removes focus.

Masked Input BindValueMode OnLostFocus

OnInput Mode

Set the editor’s BindValueMode property to OnInput to update the actual editor value each time when the user changes the input value:

<DxMaskedInput @bind-Value="@Price"
               Mask="@NumericMask.Currency"
               BindValueMode="BindValueMode.OnInput" />

@code {
    double Price { get; set; } = 0;
}

Masked Input - OnInput Mode

OnDelayedInput Mode

Set the editor’s BindValueMode property to OnDelayedInput to delay value updates. If a user changes the input value, the editor does not react immediately - it waits for the user to be idle for a certain time (InputDelay). Once the idle interval elapses, the editor applies all accumulated value changes at once.

Use this mode if you want fewer value updates (better client-side performance) and not rely on input focus changes.

The example below shows the Masked Input editor that updates its value after a user is idle for 1 second (1,000ms):

<DxMaskedInput @bind-Value="@Price"
               Mask="@NumericMask.Currency"
               BindValueMode="BindValueMode.OnDelayedInput"
               InputDelay="1000" />

@code {
    double Price { get; set; } = 0;
}

Masked Input - OnDelayedInput Mode

Run Demo: Masked Input - Bind Value On Input Change

See Also