Class ChangeEventArgs<TValue, TItem>
Provides event data for a change event, which occurs when the value or selected item changes in a supporting Syncfusion dropdown component.
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class ChangeEventArgs<TValue, TItem> : Object
Type Parameters
Name | Description |
---|---|
TValue | The value type(s) (e.g., |
TItem | The type of the bound item for the dropdown value (e.g., a POCO or |
Remarks
ChangeEventArgs can be used to identify the new and previous selection, whether the user made the change, and allows for cancellation of a value change before it commits to the model.
Examples
void OnChange(ChangeEventArgs<string, MyItem> args)
{
if (args.IsInteracted && args.Value != args.PreviousItemData?.Id)
args.Cancel = true;
}
Constructors
ChangeEventArgs()
Declaration
public ChangeEventArgs()
Properties
Cancel
Gets or sets a flag to cancel this value or selection change in the dropdown.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
E
(Obsolete) Original browser event for backward compatibility only.
Declaration
public object E { get; set; }
Property Value
Type |
---|
System.Object |
Element
(Obsolete) DOM element reference for legacy integrations only.
Declaration
public DOM Element { get; set; }
Property Value
Type |
---|
DOM |
IsInteracted
Gets or sets a value indicating whether the change event was triggered by user interaction.
Declaration
public bool IsInteracted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Item
(Obsolete) Previously selected DOM item. For legacy use only.
Declaration
public DOM Item { get; set; }
Property Value
Type |
---|
DOM |
ItemData
Gets information about the data item currently selected by the user.
Declaration
public TItem ItemData { get; }
Property Value
Type |
---|
TItem |
PreviousItem
(Obsolete) Previously selected DOM item before this change. For legacy use only.
Declaration
public DOM PreviousItem { get; set; }
Property Value
Type |
---|
DOM |
PreviousItemData
Gets information about the data item that was previously selected before this event.
Declaration
public TItem PreviousItemData { get; }
Property Value
Type |
---|
TItem |
Value
Gets or sets the final selected value for this change event.
Declaration
public TValue Value { get; set; }
Property Value
Type |
---|
TValue |