Back to Devexpress

ParameterValueChangingEventArgs<T> Class

blazor-devexpress-dot-blazor-dot-parametervaluechangingeventargs-1.md

latest1.5 KB
Original Source

ParameterValueChangingEventArgs<T> Class

Contains data for ***Changing events.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public class ParameterValueChangingEventArgs<T> :
    EventArgs

Type Parameters

NameDescription
T

The data type.

|

Remarks

You can use ***Changing events to validate a component parameter’s new value and cancel it if needed.

In the following code, the Memo’s TextChanging event handler cancels input if the text exceeds 500 characters. The current text is updated via two-way binding (@bind-Text).

razor
<DxMemo @bind-Text="@MemoText"
        TextChanging="@OnTextChanging"
        BindValueMode="BindValueMode.OnInput">
</DxMemo>

<div class="mt-2">
    <span>Text length: @(MemoText?.Length ?? 0)</span>
</div>

@code {
    string MemoText { get; set; }

    private void OnTextChanging(ParameterValueChangingEventArgs<string> e) {
    if (e.NewValue.Length > 500) {
        e.NewValue = e.OldValue;
    }
}

Inheritance

Object EventArgs ParameterValueChangingEventArgs<T>

See Also

ParameterValueChangingEventArgs<T> Members

DevExpress.Blazor Namespace