Class RangeEventArgs
Provides event arguments for the RangeSelected event when a date range is selected.
Inheritance
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 |
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 |
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 |
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 |
|
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 |
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 |
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 |
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.