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

Date Blur

2 Answers 24 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
humam
Top achievements
Rank 1
humam asked on 16 Apr 2011, 08:21 PM
hi, I couldn't know how to blur (cannot be selected anymore dates) and keep today's date and the following dates enabled and can be selected.

2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 19 Apr 2011, 01:18 PM
Hello,

You can disable the dates in the calendar before today in the following way:

this.radCalendar1.ElementRender += new Telerik.WinControls.UI.RenderElementEventHandler(radCalendar1_ElementRender);
this.radCalendar1.SelectedDate = DateTime.Today;

void radCalendar1_ElementRender(object sender, Telerik.WinControls.UI.RenderElementEventArgs e)
{
    if (e.Day.Date < DateTime.Today)
    {
        e.Element.Enabled = false;
    }
    else
    {
        e.Element.Enabled = true;
    }
}

Hope that helps but let me know if you need further information
Richard
0
Ivan Todorov
Telerik team
answered on 20 Apr 2011, 08:07 PM
Hi humam,

Richard's solutions is correct. Please let us know if you need any further help.

Regards,
Ivan Todorov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
humam
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Ivan Todorov
Telerik team
Share this question
or