Selected date indicator

4 posts, 0 answers
  1. Paul
    Paul avatar
    9 posts
    Member since:
    Dec 2011

    Posted 22 Dec 2011 Link to this post

    Hi Telerik

    Is there any way of changing the selected day indicator?  In my calendar I colour the whole day cell therefore when a user taps the date, it doesn't highlight.

    Is there anyway of:

    a - changing the colour of the day number for example?
    b - making the select colour appear over the rectangle that fills the day?
    c - showing an icon on the day that is selected?

    Thanks in advance

  2. Todor
    Admin
    Todor avatar
    643 posts
    Member since:
    Sep 2012

    Posted 27 Dec 2011 Link to this post

    Hi Paul,

    Thank you for your interest in RadCalendar. You can style the selected days any way you want including changing the color and adding an icon by creating an SpecialTemplate. An example and more information about the SpecialTemplate is available here. To add the SpecialTemplate on the selected days you just need to use a SelectTemplate like this:

    public override DataTemplate SelectTemplate(object item, DependencyObject container)
    {
        CalendarButton button = container as CalendarButton;
                 
        if (!button.IsFromCurrentView) return null;
     
        if (button.IsSelected)
        {
            return SpecialTemplate;
        }
     
        return base.SelectTemplate(item, container);
    }


    I hope this helps. Let me know if I can assist you further.

    Regards,
    Todor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft Release
  4. AbdouMoumen
    AbdouMoumen avatar
    6 posts
    Member since:
    Oct 2010

    Posted 31 Mar 2012 Link to this post

    Hi Todor,

    This used to work in the previous version (2011.3.1221.2040), because the SelectTemplate method of the DataTemplateSelector was being called whenever the selection changes. In the newest version however (2012.1.0321.2040) this doesn't happen, and I couldn't find a way to work around it. I wanted to try and change the template for the entire RadCalendar control, but it isn't possible to "Edit a Copy..." of the template in blend.
    All I want to do is change the overlay color on the selected day. Since my background is white, and the default overlay is transluscent white, it isn't visible at all.
    Is there another way to achieve this?

    Thanks

  5. Todor
    Admin
    Todor avatar
    643 posts
    Member since:
    Sep 2012

    Posted 03 Apr 2012 Link to this post

    Hi Abdelmoumen,

    Thank you for contacting us.

    We have made some improvements to make RadCalendar even faster and one of the changes has this side effect. This is not the desired behavior and we are going to fix it. The internal build containing the fix will be available for download next week. Please let us know if this doesn't fit your schedule and we can prepare a private build especially for you earlier.

    I have updated your account with 1000 points for reporting this issue.

    Regards,
    Todor
    the Telerik team

    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

Back to Top