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

Selected date indicator

3 Answers 104 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 22 Dec 2011, 12:07 PM
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

3 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 27 Dec 2011, 09:41 AM
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 >>

0
AbdouMoumen
Top achievements
Rank 1
answered on 31 Mar 2012, 05:02 PM
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
0
Todor
Telerik team
answered on 03 Apr 2012, 04:51 PM
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 >>
Tags
Calendar
Asked by
Paul
Top achievements
Rank 1
Answers by
Todor
Telerik team
AbdouMoumen
Top achievements
Rank 1
Share this question
or