On select date, date not highlighted

3 posts, 1 answers
  1. Martin
    Martin avatar
    14 posts
    Member since:
    Jan 2008

    Posted 28 Jan 2015 Link to this post

    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. Answer
    Yoanna
    Admin
    Yoanna avatar
    44 posts

    Posted 29 Jan 2015 Link to this post

    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.

     
  3. DevCraft banner
  4. Martin
    Martin avatar
    14 posts
    Member since:
    Jan 2008

    Posted 30 Jan 2015 in reply to Yoanna Link to this post

    Thanks Yoanna, that did the trick!
Back to Top