ParameterValueChangingEventArgs<T> Class
Contains data for ***Changing events.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.2.dll
Declaration
public class ParameterValueChangingEventArgs<T> :
EventArgs
Type Parameters
| Name | Description |
|---|---|
| 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).
<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;
}
}
See Also