menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChangeEventArgs<T> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChangeEventArgs<T>

    Provides strongly-typed event arguments for change events in calendar and time picker components.

    Inheritance
    System.Object
    ChangeEventArgs<T>
    Namespace: Syncfusion.Blazor.Calendars
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChangeEventArgs<T> : Object
    Type Parameters
    Name Description
    T

    The type of the component's value (typically System.DateTime or nullable System.DateTime).

    Remarks

    This generic class provides comprehensive information about value changes in date/time picker components. It includes the new value, formatted text representation, interaction details, and references to the original browser event and DOM element. This allows for detailed handling of value change scenarios.

    Examples
    <SfTimePicker TValue="DateTime?">
        <TimePickerEvents TValue="DateTime?" ValueChange="OnTimeChanged"></TimePickerEvents>
    </SfTimePicker>
    
    @code {
        void OnTimeChanged(ChangeEventArgs<DateTime?> args)
        {
            if (args.IsInteracted && args.Value.HasValue)
            {
                Console.WriteLine($"User selected time: {args.Value}");
                Console.WriteLine($"Formatted text: {args.Text}");
            }
        }
    }

    Constructors

    ChangeEventArgs()

    Declaration
    public ChangeEventArgs()

    Properties

    Element

    Gets or sets the DOM element associated with the change event.

    Declaration
    public object Element { get; set; }
    Property Value
    Type Description
    System.Object

    An object representing the DOM element where the value change occurred. The default value is null.

    Remarks

    This property provides access to the DOM element that was involved in the value change event, allowing for additional manipulation, styling, or inspection of the element during event handling.

    Event

    Gets or sets the original browser event that triggered the value change.

    Declaration
    public object Event { get; set; }
    Property Value
    Type Description
    System.Object

    An object containing the original event arguments from the browser. The default value is null.

    Remarks

    This property contains the raw browser event information, such as input events, click events, or keyboard events, that caused the component's value to change. It provides access to the underlying event details for advanced event handling scenarios.

    IsInteracted

    Gets or sets a value indicating whether the change was triggered by user interaction.

    Declaration
    public bool IsInteracted { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the value change was triggered by user interaction; otherwise, false.

    Remarks

    This property helps distinguish between programmatic value changes and user-initiated changes. When true, the value change was caused by user actions such as typing, clicking, or keyboard navigation. When false, the value change was likely caused by programmatic updates to the component's value.

    Text

    Gets or sets the formatted text representation of the selected value.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String

    A string containing the formatted value text. The default value is null.

    Remarks

    This property contains the human-readable string representation of the selected date/time value, formatted according to the component's format settings and culture-specific formatting rules. This is the text that appears in the component's input field.

    Value

    Gets or sets the selected date/time value.

    Declaration
    public T Value { get; set; }
    Property Value
    Type Description
    T

    A value of type T representing the selected date/time value. The default value is default(T).

    Remarks

    This property contains the strongly-typed date/time value that was selected or changed in the component. The type is determined by the generic parameter, allowing for flexibility in different date/time picker implementations.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved