menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RangeEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RangeEventArgs

    Provides event arguments for the RangeSelected event when a date range is selected.

    Inheritance
    System.Object
    RangeEventArgs
    Namespace: Syncfusion.Blazor.Calendars
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class RangeEventArgs : Object
    Remarks

    This class contains comprehensive information about date range selection, including start and end dates, the span between dates, and details about the user interaction. It provides all the necessary data for handling range selection events in date range picker components.

    Examples
    <SfDateRangePicker TValue="DateTime?">
        <DateRangePickerEvents TValue="DateTime?" RangeSelected="OnRangeSelected"></DateRangePickerEvents>
    </SfDateRangePicker>
    
    @code {
        void OnRangeSelected(RangeEventArgs args)
        {
            Console.WriteLine($"Range selected: {args.StartDate} to {args.EndDate}");
            Console.WriteLine($"Days in range: {args.DaySpan}");
        }
    }

    Constructors

    RangeEventArgs()

    Declaration
    public RangeEventArgs()

    Properties

    DaySpan

    Gets or sets the number of days between the start and end dates of the selected range.

    Declaration
    public double DaySpan { get; set; }
    Property Value
    Type Description
    System.Double

    A double value representing the number of days in the selected date range.

    Remarks

    This property calculates the span between the start and end dates, providing the total number of days included in the selected range. This is useful for validating range constraints and displaying range duration information to users.

    Element

    Gets or sets the DOM element associated with the range selection event.

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

    An object representing the DOM element involved in the range selection. The default value is null.

    Remarks

    This property provides access to the DOM element that was involved in the range selection event, allowing for additional manipulation or inspection of the element if needed.

    EndDate

    Gets or sets the end date of the selected range.

    Declaration
    public DateTime EndDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    A System.DateTime value representing the end date of the selected range.

    Remarks

    This property contains the last date in the selected date range. Together with StartDate, it defines the complete date range selection.

    Event

    Gets or sets the original browser event that triggered the range selection.

    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 that caused the date range selection. It provides access to the underlying event details for advanced event handling scenarios.

    IsInteracted

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

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

    true if the range selection was triggered by user interaction; otherwise, false.

    Remarks

    This property helps distinguish between programmatic range selections and user-initiated selections. When true, the range selection was caused by user actions like clicking on dates. When false, the range selection was likely caused by programmatic updates.

    Name

    Gets or sets the name of the range selection event.

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

    A string value representing the event name. The default value is null.

    Remarks

    This property specifies the name identifier for the range selection event, which can be used to identify the specific type of range selection event in event handling scenarios.

    StartDate

    Gets or sets the start date of the selected range.

    Declaration
    public DateTime StartDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    A System.DateTime value representing the start date of the selected range.

    Remarks

    This property contains the first date in the selected date range. Together with EndDate, it defines the complete date range selection.

    Text

    Gets or sets the formatted text representation of the selected date range.

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

    A string value containing the formatted date range text as displayed in the input element. The default value is null.

    Remarks

    This property contains the human-readable string representation of the selected date range, typically formatted according to the component's format settings and displayed in the input field.

    Value

    Gets or sets the value object representing the selected date range.

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

    An object containing the selected date range value. The default value is null.

    Remarks

    This property contains the complete value object representing the selected date range, which may include additional metadata beyond just the start and end dates.

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