Calendar Special Days Properties

3 posts, 0 answers
  1. lesley
    lesley avatar
    5 posts
    Member since:
    Apr 2012

    Posted 25 Jul 2014 Link to this post

    The Special Days properties are having no effect.

    Disabled = true  -  Expected it to grey out the day. I get a normal, still selectable special day.
    Selectable = false - Expected that when that day is clicked no selection occurs -  I get a normal, still selectable special day.
    Selected = false - Expected the day not to be highlighted - I get a highlighted special day.

    Toggling these properties to true or false seems to have no effect. The special day is still enabled, selectable and highlighted.

    The other properties seem to function ok. Setting the date of the day, recurring and the tooltip are ok.

    Am I missing a setting? misinterpreting the behaviours?

    Tested using a new standard winforms application.
    Controls version 2014.2.715.40

  2. Ralitsa
    Ralitsa avatar
    175 posts

    Posted 29 Jul 2014 Link to this post

    Hi Lesley, 

    Thank you for contacting us. 

    I investigated your case and indeed setting the Disabled, Selectable or Selected properties of special day has no affect. I confirm that is an issue in our RadCalendar and have logged it in our Feedback Portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - Feedback Item

    Meanwhile you can use the following approaches: 

    1. If you want to disable the cell, you can set the Enabled property to false. For the purpose, you can subscribe to the ElementRender event. Please take a look at the following code snippet: 

    a) subsribe to the event: 
    this.radCalendar1.ElementRender += radCalendar1_ElementRender;

    b) set the Enabled to false 
    void radCalendar1_ElementRender(object sender, RenderElementEventArgs e)
        if (e.Day.Date == this.radCalendar1.SpecialDays[1].Date)
            e.Element.Enabled = false;
            e.Element.ResetValue(LightVisualElement.EnabledProperty, ValueResetFlags.Local);

    2. If you want to cancel selection of specific date, you can subscribe to SelectionChanging event: 

    a) subscribe to teh SelectionChanging event: 
    this.radCalendar1.SelectionChanging += radCalendar1_SelectionChanging;

    b) cancel the selection of special day
    void radCalendar1_SelectionChanging(object sender, SelectionEventArgs e)
                if (e.NewDates.Count > 0)
                    foreach (RadCalendarDay item in this.radCalendar1.SpecialDays)
                        if (item.Date == e.NewDates[0].Date)
                            e.Cancel = true;

    You can refer to attached sample project which demonstrates you the suggested approaches. 

    I have also updated your Telerik Points for reporting these cases. 

    Let me know if you have any other questions.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft R3 2016 release webinar banner
  4. lesley
    lesley avatar
    5 posts
    Member since:
    Apr 2012

    Posted 30 Jul 2014 Link to this post

    Hi Ralitsa,

    Thank you for the reply. At least now I know its not my setup or installation that is a fault.

    Thank you also for the code.
    This works well for the project I need the Calendar for.
Back to Top