How to set selected date circle background

5 posts, 0 answers
  1. willem odendaal
    willem odendaal avatar
    2 posts
    Member since:
    Sep 2009

    Posted 06 Feb 2015 Link to this post

    I would like to change the background color of the selected date's *circle*.

    How do I do that?

    I have tried setting a custom color like so, but this does not have any effect:
        dayCell.Style.DefaultSelectionColor = UIColor.Red;
  2. willem odendaal
    willem odendaal avatar
    2 posts
    Member since:
    Sep 2009

    Posted 06 Feb 2015 Link to this post

    I found the solution. Not difficult, "Shape" is what needs to be modified:

        cell.Style.ShapeStroke = new TKStroke (UIColor.Red); 
        cell.Style.ShapeFill = new TKSolidFill (UIColor.Red);
  3. DevCraft banner
  4. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 06 Feb 2015 Link to this post

    Hi Willen,

    Thank you for contacting us. I am glad to hear that you have solved your issue. You can read more about TKCalendar and how to customize it in our online documentation. Do not hesitate to contact us id you have further questions.

    Regards,
    Jack
    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.

     
  5. asdas
    asdas avatar
    1 posts
    Member since:
    Oct 2015

    Posted 14 Oct 2015 in reply to willem odendaal Link to this post

    Hi willem, 

    even i am looking for something similar, but i am not able locate the cell of the selected date through this method. 

    (void)calendar:(TKCalendar* __nonnull)calendar didSelectDate:(NSDate* __nonnull)date. 

    could you please brief out how u achieved this. 

  6. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 14 Oct 2015 Link to this post

    Hi Asdas,

    You can use the cellForDate method in TKCalendarMonthPresenter for this purpose. Consider the sample below:
    TKCalendarMonthPresenter *presenter = (TKCalendarMonthPresenter*)self.calendarView.presenter;
    TKCalendarDayCell *cell = [presenter cellForDate:date];

    Please note that like in UITableView, TKCalendar uses UI virtualization. This means that cells are reused when navigating to a different month for example. So, the best way to manipulate cell appearance in TKCalendar is by implementing calendar:updateVisualsForCell: method of TKCalendarDelegate. You can find further information related with TKCalendar customization in our online documentation.

    I hope this helps.

    Regards,
    Jack
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner