RadDock - Auto Hidden Tool Window - Update Contained Calendar Control When 'Un-Hidden'

2 posts, 0 answers
  1. grahame mcgirr
    grahame mcgirr avatar
    2 posts
    Member since:
    Jul 2009

    Posted 09 Dec 2009 Link to this post

    I have a Calendar control that is contatined within a Tool Window.

    The Tool Window is hidden on startup.

    When the Tool Window becomes 'un-hidden' I need to refresh the calendar control, i.e. change back colour for some of the dates.

    Trouble is I've no idea what event is going to give me the opportunity to do this:(

    Can anyone help me out here?

  2. Nikolay
    Nikolay avatar
    1802 posts

    Posted 11 Dec 2009 Link to this post

    Hello grahame mcgirr,

    When a ToolWindow is hidden and then you show it, the DockStateChanging/DockStateChanged events are fired. This is the place where you can change the appearance of RadCalendar. Please refer to the following code snippet:

    void radDock1_DockStateChanging(object sender, DockStateChangingEventArgs e)
        if (e.DockWindow.Name == "toolWindow2")
            if (e.DockWindow.DockState == DockState.Hidden)
                // do sth with RadCalendar

    The easiest option for you to change the color of specific dates is to add these dates in the RadCalendar.SpecialDays collection:

    this.radCalendar1.SpecialDays.Add(new RadCalendarDay(DateTime.Now.Date.AddDays(1)));

    This will change the color of the date cells to the color defined by the theme.

    I hope this helps. If you have additional questions, feel free to contact me.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft R3 2016 release webinar banner
Back to Top