This is a migrated thread and some comments may be shown as answers.
RadDock - Auto Hidden Tool Window - Update Contained Calendar Control When 'Un-Hidden'
1 Answer 46 Views
This is a migrated thread and some comments may be shown as answers.
grahame mcgirr
Top achievements
Rank 1
grahame mcgirr asked on 09 Dec 2009, 10:27 AM
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?

Thx

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 11 Dec 2009, 09:36 AM
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,
Nikolay
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.
Tags
Dock
Asked by
grahame mcgirr
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or