Breaking Change T900084
Visible to All Users

Calendar - The DxCalendar class and specific API members have become generic-typed

What Changed

The DxCalendar class became generic-typed.

Old:

C#
public class DxCalendar {...}

New:

C#
public class DxCalendar<T> {...}

The SelectedDates property and the SelectedDatesChanged event changed their signature.

Old:

C#
public IEnumerable<DateTime> SelectedDates { get; set; } public Action<IEnumerable<DateTime>> SelectedDatesChanged { get; set; }

New:

C#
public IEnumerable<T> SelectedDates { get; set; } public EventCallback<IEnumerable<T>> SelectedDatesChanged { get; set; }

Reasons for Change

In previous versions, the Calendar component operated with the DateTime type only. In v20.1.6, we made this component generic-typed and updated the required API to support both the DateTime and Nullable DateTime types.

Impact on Existing Apps

This change will affect your application in the following cases:

  • If you add the DxCalendar component to markup and do not use two-way binding.
Razor
<DxCalendar/>
C#
builder.OpenComponent<DxCalendar>(seq++)

Your code with the SelectedDates property will compile and work without changes. For information on how to update the SelectedDatesChanged event, refer to the following Breaking Change: T920147

How to Update Existing Apps

If you use the component in markup, do either of the following:

  • Specify the component data type explicitly.
Razor
<DxCalendar T="DateTime"/>
Razor
<DxCalendar @bind-SelectedDate="@SelectedDate" /> @code { DateTime selectedDate = DateTime.Now; DateTime SelectedDate { get => selectedDate; set { selectedDate = value; InvokeAsync(StateHasChanged); } } }

If you create the Calendar component in C# code, specify the component type as follows:

  • for the DateTime type:
C#
builder.OpenComponent<DxCalendar<DateTime>>(seq++);
  • for the Nullable DateTime type:
C#
builder.OpenComponent<DxCalendar<DateTime?>>(seq++);

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.