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

How to disable StartDate and EndDate controls

3 Answers 53 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael Malone
Top achievements
Rank 1
Michael Malone asked on 24 Sep 2010, 03:03 PM
I need to prevent the user from changing the start and end date in the AdvancedForm. I managed to get a reference to the controls in FormCreated() and set their Enabled property to False. This works as expected, but if I click inside the disabled control it throws a javascript error of "Microsoft JScript runtime error: 'undefined' is null or not an object".  How can I disable these controls without causing an error? 

void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)
{
        if (e.Container.Mode == SchedulerFormMode.AdvancedInsert
            || e.Container.Mode == SchedulerFormMode.AdvancedEdit)
        {
             
 
            RadDatePicker startDate = (RadDatePicker)e.Container.FindControl("StartDate");
            startDate.Enabled = false;
 
        }
 
}

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 27 Sep 2010, 01:50 PM
Hi Michael,

In the ticket info I see you are using version 2010.2 826. Is that true?

I tried to reproduce the issue with this version and no javascript error appears.

Greetings,
Veronica Milcheva
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
0
Michael Malone
Top achievements
Rank 1
answered on 29 Sep 2010, 02:45 PM
Correct, that is the version I am using. Setting Enabled=false still causes the javascript error. Setting "ReadOnly=true" does not cause an error.
0
Veronica
Telerik team
answered on 29 Sep 2010, 03:38 PM
Hi Michael Malone,

Have you customized the Advanced Form? I can not reproduce the issue.
Could you please send me your code so I can inspect it and help you?

All the best,
Veronica  Milcheva
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
Scheduler
Asked by
Michael Malone
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Michael Malone
Top achievements
Rank 1
Share this question
or