Resource Availability Application Scenario: Assigning multiple resources (users) to an appointment

3 posts, 0 answers
  1. George
    George avatar
    25 posts
    Member since:
    Oct 2008

    Posted 07 Jun 2012 Link to this post

    Hello,

    How could i assign multiple resources (users) to an appointment? I'm using RadComboCox as CheckBox (CheckBoxes="true" EnableCheckAllItemsCheckBox="true") :
    <telerik:RadComboBox CheckBoxes="true" EnableCheckAllItemsCheckBox="true" runat="server" ID="UsersComboBox" DataTextField="Text" DataValueField="Key"
                               Width="80px" Skin="Default" SelectedValue='<%# Bind("UserID") %>' DataSource="<%# GetAvailableUsers(Container) %>">
                           </telerik:RadComboBox>
     
    and i have made the following changes to the RadScheduler1_AppointmentCreated event with no result.

    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
       {
     
           List<string> users = new List<string>();
           foreach (Resource user in e.Appointment.Resources.GetResourcesByType("User"))
           {
               users.Add(user.Text);
           }
     
           if (users.Count > 0)
           {
               Label assignedTo = (Label)e.Container.FindControl("AssignedTo");
               assignedTo.Text = "Assigned to: " + string.Join(", ", users.ToArray());
           }
     
       }


    How could i bind the users so as to have a result like: "Held by: Charlie, Alex"?

    Thank you very much.
  2. George
    George avatar
    25 posts
    Member since:
    Oct 2008

    Posted 10 Jun 2012 Link to this post

    Any answer?
  3. Plamen
    Admin
    Plamen avatar
    3048 posts

    Posted 12 Jun 2012 Link to this post

    Hello George,

     
    The code behind that you pasted is the same as in our Multiple Resource Values. If you want to use multiple resources in an Advanced Template we recommend using code as in this demo. We usually recommend implementation with a user control with multiple check boxes as in the example. If you want to replace it with RadCombobox you will have to add it in the MultipleValueResourceControl page and populate each checked resource.

    Hope this information will be helpful.

    All the best,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top