Make a resource required?

4 posts, 0 answers
  1. Rick
    Rick avatar
    58 posts
    Member since:
    Dec 2006

    Posted 07 Jan 2011 Link to this post

    I have three resources added and when someone creates and saves an appointment I want the resource to be required, is there and easy way to do this? Is this functionality built in?
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 10 Jan 2011 Link to this post

    Hi mystrymaster,

    To be able to make the resource required you can remove the default "-" item in the RadCombobox so that each time an item will be selected. Here's the code for this:

    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
       {
           if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit)||(e.Container.Mode == SchedulerFormMode.AdvancedInsert))
           {
               RadComboBox roomsCombo = e.Container.FindControl("ResRoom") as RadComboBox;
               roomsCombo.Items[0].Remove();
           }
       }

    Please note that in the above code, 'Room' is the resource type name, but we need the 'res' prefix also to find the combobox control.

    Feel free to ask me if you have further questions.

    Regards,
    Veronica Milcheva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Rick
    Rick avatar
    58 posts
    Member since:
    Dec 2006

    Posted 10 Jan 2011 Link to this post

    That doesn't make it required though, that just default selects something for them.

    There is no way to make it required?
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 13 Jan 2011 Link to this post

    Hello mystrymaster,

    To make the resource required with appropriate error message you need RequiredFieldValidator. To add validators in the AdvancedForm you'll need to customize the AdvancedForm.

    Please take a look at the attached sample project in the .zip file for an example.

    Kind regards,
    Veronica Milcheva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top