alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ChangeEventArgs<T>

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

    Inheritance
    object
    ChangeEventArgs<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.Calendars
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChangeEventArgs<T>
    Type Parameters
    Name Description
    T

    The type of the component's value (typically DateTime or nullable 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
    [JsonPropertyName("element")]
    public object Element { get; set; }
    Property Value
    Type Description
    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
    [JsonPropertyName("event")]
    public object Event { get; set; }
    Property Value
    Type Description
    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
    [JsonPropertyName("isInteracted")]
    public bool IsInteracted { get; set; }
    Property Value
    Type Description
    bool

    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
    [JsonPropertyName("text")]
    public string Text { get; set; }
    Property Value
    Type Description
    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
    [JsonPropertyName("value")]
    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.

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