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

GroupBy and related RadComboBox

4 Answers 80 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 29 Apr 2010, 04:50 AM
So I followed the related RadComboBox examples and have implemented a set of ComboBox controls (where one combo box is dependent on the value selected in the other). This was implmented via Custom Attributes and therefore, I no longer use the "ResourceControl" functionality. This works fine. However, I need to implement the GroupBy functionality for these custom attributes, and I think I lose this functionality when I move to using Custom Attributes. I need to implement functionality as follows:
1) I would like the caledar to show my resources via a GroupBy across the top, which is doable if you use the "GroupBy" property in the radScheduler.
2) When I select an appointment under this GroupBy resource, I now need my custom attribute to reflect this i.e. my radComboBox that corresponds to the GroupBy resource should select the appropriate entry in the dropdown list which corresponds to the GroupBy resource (which then populates my related radComboBox).

Perhaps I can clarify this with an example:
I have 3 resources, Room 101, Room 102, and Room 103
I have 6 other related resources, namely Bob, Carol, Ted, Alice, Biff and Muffy.
Bob and Carol can only be assigned to Room 101, Ted and Alice can only be assigned to Room 102, Biff and Muffy to Room 103
When Room 101 is selected in the Room combobox, only Ted and Alice should appear in the User combobox etc.
I have done this via the examples provided by implementing related radComboBoxes and custom attributes in the advanced edit form.

However, I wish to have a GroupBy Room so that my Rooms appear across the top of my calendar.
When I select an appointment to insert under a particular room, I need to pass that selection on to my radComboBox for my Room resource so that the appropriate value gets selected. How can I do this?

Hope this makes sense. Any help would be appreciated.

4 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 30 Apr 2010, 03:35 PM
OK...so I figured out how to do the GroupBy so that my appointments show in the Calendar...here are the steps that I took:

I created a shadow resource called Room_Shadow. I group by this shadow resource. At the point in my Custom Data Provider that I load the Rooms into my Custom Attribute, I also add the rooms to the resource under the resource name "Room_Shadow".
Now all my appointments appear in the correct locations in my calendar under the proper resource column. I don't need to save this shadow resource in my DB as it is a duplicate of my Custom Attribute "Room".

Now all I need is a way to intercept the resource under which a new appointment is to be inserted so I can set up the appropriate selected values in my Custom Attribute radComboBoxes for my Advanced Edit window.
0
Peter
Telerik team
answered on 03 May 2010, 12:13 PM
Hi Tweek,

Here is how to get the resource in AppointmentInsert:

protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
   {
        
       //e.Appointment.Resources.GetResourceByType("Room_Shadow").Key
   }



Kind regards,
Peter
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
Andrew
Top achievements
Rank 1
answered on 05 May 2010, 03:50 AM
The AppointmentInsert event happens after all of the values have been selected in the Advanced Edit form. This is not what I need, so perhaps I did not explain myself correctly.

I need to find out the value of the shadow resourece so I can select a value in my first Custom Attribute RadComboBox in my Advanced Edit form so that the second one gets filtered based on which resource column the appointment was clicked under. I can't do this on the server side I don't think. This is the functionality that is provided if I use the "Resources" functionality in the RadScheduler, but not if I make my resources "Custom Attributes"

I think I have to do this in javascript but I am not sure where. Can I access my RadComboBox in the advanced edit form before it is popped up? If not then I cannot use the OnClientAppointmentInserting client side event. Do I have to modify the AdvancedForm.js script to do this?
0
Dimitar Milushev
Telerik team
answered on 10 May 2010, 10:04 AM
Hello,

You can use the FormCreated server-side event and check the Resources of the Appointment that is passed through the event arguments. The Appointment should have the proper Resource set depending on which is clicked.

I hope this helps.

All the best,
Dimitar Milushev
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
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Peter
Telerik team
Dimitar Milushev
Telerik team
Share this question
or