This is a migrated thread and some comments may be shown as answers.

On select date, date not highlighted

2 Answers 31 Views
Calendar - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 28 Jan 2015, 09:44 AM
I have a Calendar with, beneath it, a UITableView that lists the events of a specific date. When the user selects a date, the UITableView updates with the events for that day. However, now the selected date is not highlighted (i.e. there isn't a circle around the date) - have to tap the date again for it to be highlighted.

Can I "force" the date to be highlighted in the DidSelectDate() method? Any other suggestions?

Thanks

Martin

2 Answers, 1 is accepted

Sort by
0
Accepted
Yoanna
Telerik team
answered on 29 Jan 2015, 04:17 PM
Hello, Martin, 

Thank you for contacting us.

TKCalendar has a SelectedDate property which accounts for the currently selected date when TKCalendar is set to a single selection. By this property you can force any date between your MaxDate and MinDate appear selected. 

Consider the code snippet below:
NSDateComponents components = new NSDateComponents ();
components.Day = -1;
NSDate selectedDate = nsCalendar.DateByAddingComponents (components, NSDate.Now, (NSCalendarOptions)0);
calendar.SelectedDate = selectedDate;

I hope this answers your question. If this is not a working solution for you I will be glad  if you can open a support ticket and send us your project, so we can take a closer look at what the reason for your issue might be. 

Best regards,
Yoanna
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Martin
Top achievements
Rank 1
answered on 30 Jan 2015, 08:04 AM
Thanks Yoanna, that did the trick!
Tags
Calendar - Xamarin.iOS
Asked by
Martin
Top achievements
Rank 1
Answers by
Yoanna
Telerik team
Martin
Top achievements
Rank 1
Share this question
or