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

How to make Validation For DataDescription Field

1 Answer 47 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
kasi
Top achievements
Rank 1
kasi asked on 04 Jul 2011, 02:40 PM
Hi,
Can you please tel me how to validate the DataDescription Fields and Some others Custom Fields Which we added in Scheduler, I m using Defalut Data Forms.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Jul 2011, 02:26 PM
Hello Kasi,

One possible solution is to customize the advanced form as you want.
Please, take a look at our Advanced Template Demo where you can customize your form as you want. In your case you can put RequiredFieldValidators like it is done for the Subject field.

Another way is to validate on Insert/Update event like here:
protected void RadScheduler1_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
   {
       String csname1 = "PopupScript";
       Type cstype = this.GetType();
       // Get a ClientScriptManager reference from the Page class.
       ClientScriptManager cs = Page.ClientScript;
       // Check to see if the startup script is already registered.
       if (String.IsNullOrEmpty(e.Appointment.Description))
       {
           String cstext1 = "alert('The duration field should not be empty!');";
           cs.RegisterStartupScript(cstype, csname1, cstext1, true);
           e.Cancel = true;
       }
   }
   protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
   {
       String csname1 = "PopupScript";
       Type cstype = this.GetType();
       // Get a ClientScriptManager reference from the Page class.
       ClientScriptManager cs = Page.ClientScript;
       // Check to see if the startup script is already registered.
       if (String.IsNullOrEmpty(e.Appointment.Description))
       {
           String cstext1 = "alert('The duration field should not be empty!');";
           cs.RegisterStartupScript(cstype, csname1, cstext1, true);
           e.Cancel = true;
       }
   }

You can also look at this KB article to see how to accomplish this client side.

Hope this will helps

Regards,
Plamen Zdravkov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Scheduler
Asked by
kasi
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or