I am trying to find out if this is a bug or I am doing the things incorrectly I have binded the DisplayDate and SelectedDate with properties on My View Model like this:
DisplayDate=
"{Binding CalendarDisplayDate, Mode=TwoWay}"
SelectedDate=
"{Binding SelectedDate, Mode=TwoWay}"
But for some reason when I swipe the calendar to the next month, the circle is just visible for a second or so and then it disappears. I have also set those properties when the user swipes the calendar like this:
public
override
void
DidNavigateToDate(TKCalendar calendar, NSDate date)
{
var dateTime = date.ToDateTime();
if
(Element ==
null
)
{
return
;
}
Element.SelectedDate =
new
DateTime(dateTime.Year, dateTime.Month, 1);
Element.DisplayDate =
new
DateTime(dateTime.Year, dateTime.Month, 1);
Element.LoadMonthAppointmentsCommand.Execute(
null
);
}
Here is a short video:
GIF
10 Answers, 1 is accepted
Would it be possible to provide a sample so we can have a more detailed look at the exact behavior?
Regards,
Stefan Nenchev
Progress Telerik
Do you observe the issue in iOS only? Having a look at Adam's implementation, it seems that when a custom CalendarDelegate is assigned on the native control -- the SelectedDate binding is being broken and stops working. Can you please share more information on your setup so we can have it in mind and investigate what might be causing the issue?
Regards,
Stefan Nenchev
Progress Telerik
Yes, I was only having the problem inside iOS - but I never tested it in Android. I think I have it solved now. I was using an iQueryable as the data source. After adding a "ToList()" when assigning the data source, the problem seems to have gone away. Does the ListView work okay with iQueryables? I was using a linq statement from an entity framework data source to assign the data source.
We are not aware of any issues when the AppointmentsSource of the Calendar is an IQueryable so please make sure that the source collection is properly set at your end. If you believe the RadCalendar control is not working as intended, please share a sample so we can investigate the exact setup and provide you with a more detailed information.
Have a great rest of the week.
Regards,
Stefan Nenchev
Progress Telerik
hi,
i also experiencing the same behaviour only in iOS. my calendar is in week view mode. fetching data when selection date change event or display date change event, bindings as below, itemssource bind to observable collection in VM and fill data into that.
DisplayDate="{Binding SelectedDate, Mode=TwoWay}"
SelectedDate="{Binding SelectedDate, Mode=TwoWay}"
selection is there until data fill into calendar. item source refreshing cause selection disappear. Only happens in iOS
if i remove
AppointmentsSource="{Binding EventListForCal,Mode=TwoWay}"
selection highlight keeps
Thank you for providing the details.
Indeed, the selected date style is lost on iOS when the Calendar AppointmentsSource is updated. We have this issue logged in our public portal, you could follow the item below:
https://feedback.telerik.com/xamarin/1366092-calendar-ios-the-visual-state-of-the-selected-date-is-lost-when-the-appointmentssource-is-changed
in order to receive notifications on status changes.
I am afraid at this point we cannot commit to any timeframe for resolving this.
I hope it is not a show-stopper for you.
Regards,
Yana
Progress Telerik