How to make Validation For DataDescription Field

2 posts, 0 answers
  1. kasi
    kasi avatar
    29 posts
    Member since:
    May 2011

    Posted 04 Jul 2011 Link to this post

    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.
  2. Plamen
    Admin
    Plamen avatar
    2959 posts

    Posted 07 Jul 2011 Link to this post

    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!

Back to Top