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

Multiple Resource Appointment & Group By

16 Answers 370 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Maurizio Piaggio
Top achievements
Rank 1
Maurizio Piaggio asked on 08 Oct 2010, 04:32 PM
Hi,
I'm using the scheduler to organize appointments on a bunch of rooms; sometimes it happens that the appointment is not for a defined room but for any room available at that moment, i would like to have the appointment item to spread across the columns instead of having single items per every column.
I added a screen shot of what it is and what I'd like to have (manipulated by graphic tools)
Thanks in advance

16 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 14 Oct 2010, 12:07 PM
Hello Simone Ursino,

Unfortunately this is not possible. I've set the GroupBy property of the RadScheduler to "User" in the demo about "Multiple Resource Values" and here's the result:



There is no easy workaroud to make the two appointments look like one.


Greetings,
Veronica Milcheva
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
Andy
Top achievements
Rank 1
answered on 11 Jun 2012, 10:01 PM
Could you provide the code for this example.  I having problems using adding resources to an appointment object and showing them in the schedule.  I have created a resource type, but am unsure of what to use for the foreignkeyfield since the appointment doesn't have a property for a resource id, but rather a collection of resources.
0
Plamen
Telerik team
answered on 12 Jun 2012, 11:16 AM
Hello Andy,

 
You can refer to the Resource Type Collection Editor help topic where is described how to generate easily your resources from the designer. I am also attaching a sample project that implements Multiple Resources in a RadScheduler bound to a SQL DataSource. 

Hope the will be helpful.

Kind regards,
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.
0
Andy
Top achievements
Rank 1
answered on 12 Jun 2012, 12:43 PM
Thanks for the quick reply.  I am having issues running your sample code.  I am able to create and save to the database an appointment with one user resource and one room resource.  But when I select multiple user resources or multiple room resources and try to save the appointment I get the error Object must implement IConvertible - see stack trace below.  I also don't see how multiple resource selection are stored in this database.  It looks to me like there is a field in the appointment table for userid and roomid.  

To give you more info on my situation. The way our system is designed our web forms do not have direct access to the database but rather consume data provided by a middle tier.  So the SQL data source won't work.  I was following some of the examples and creating a dataprovider that providesa list of Telerik Appoinment objects and binding the RadScheduler to this list.  The  Appointment object does not have a property for resources but rather a collection of resources.  I'm not sure how to set up the resource type foreignkeyfield to map to the resource collection.  In the end I need the RadScheduler to group by the resource.



[InvalidCastException: Object must implement IConvertible.]
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.OnDataSourceOperationComplete(Int32 count, Exception e) +39
   System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +80
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.Insert(RadScheduler owner, Appointment appointmentToInsert) +184
   Telerik.Web.UI.SchedulerProviderBase.Insert(ISchedulerInfo schedulerInfo, Appointment appointmentToInsert) +62
   Telerik.Web.UI.Scheduling.AppointmentController.InsertAppointmentThroughProvider(ISchedulerInfo schedulerInfo, Appointment appointment) +100
   Telerik.Web.UI.Scheduling.AppointmentController.InsertAppointment(ISchedulerInfo schedulerInfo, Appointment appointment) +40
   Telerik.Web.UI.RadScheduler.InsertAppointmentInline() +282
   Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +483
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +125
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +169
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +9
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

0
Plamen
Telerik team
answered on 14 Jun 2012, 01:54 PM
Hi Andy,

 
It seems that I misunderstood you and provided not the right project in the previous post. Please excuse me for that mistake. Multi-valued resources are supported only with a provider so this sample should be work properly for your case.

you can also review the help topic that deeply explain this functionality. 

Hope this will help you.

Greetings,
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.
0
Andy
Top achievements
Rank 1
answered on 14 Jun 2012, 03:42 PM
Thanks for the sample project.

I have gotten past this hurdle.  I had not been fully using the provider model.  My custom provider based on SchedulerProviderBase originally had only the appointment info in it.  I was addiding the resources directly to the radScheduler.  Once I put the resources in my custom provider and matched my appointment's resources to the list of resources it all worked.
Thanks for your help.
0
Chris Phelps
Top achievements
Rank 1
answered on 21 Jun 2012, 03:33 PM
I'm having the same problem, is there a VB version of the sample code?
0
Plamen
Telerik team
answered on 26 Jun 2012, 01:34 PM
Hi Chris,

 
I am attaching the same web page in VB.

Hope this 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.
0
Chris Phelps
Top achievements
Rank 1
answered on 27 Jun 2012, 02:06 PM
Thank you very much!
0
Kenny
Top achievements
Rank 1
answered on 05 Oct 2012, 05:22 AM
I need a help. The attached sample for VB is not fully working, if I declare Public MustInherit Class SchedulerDBProvider, then I can't declare the instance in code behind. What can i do, your help is really appreciate.

See the attachment. Thanks
0
Kenny
Top achievements
Rank 1
answered on 09 Oct 2012, 04:28 AM
hello, any insight about this? I am totally stuck here and need the help urgently.
Thanks
0
Plamen
Telerik team
answered on 09 Oct 2012, 06:56 AM
Hi Kenny, 

 
I have tested the "MultipleResourcesWith-DaBinVB.zip" project once again and it worked properly at my side. Here is a video of my test. Would you please explain what should be changed in it in order to observe the issue you are experiencing because it is not quite clear?

Greetings,
Plamen
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.
0
Kenny
Top achievements
Rank 1
answered on 09 Oct 2012, 11:09 AM
Thanks Plamen.
Actually I just download the VB version and do nothing change on it, however once I open the scheduerDBProvider class, it already shown me the error as show in the picture below, of course compiliation will give me the similar error.
http://www.telerik.com/ClientsFiles/395600_SchedulerDBProvider.gif

Beside this, i also saw some error in Insert, Delete, Update and GetAppointment function. I attached another screen shot here. Is this caused by this version of Telerik? I am using Telerik.Web.UI.dll, version 2012.2.713.20
Your help is very much appreciated, as I totally stuck to support multiple appointments. Thanks
0
Plamen
Telerik team
answered on 12 Oct 2012, 06:16 AM
Hi Kenny,

 
I have inspected the Web Site that you pointed once again but unfortunately could not observe the described issue. I created a solution based on it and it worked properly as well. Here is a video of my test. 

If you still observe the unusual behavior please explain what should we do  in order to observe the same at our side so we can be able to research it and suggest a solution.

All the best,
Plamen
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.
0
Srivalli
Top achievements
Rank 1
answered on 18 Aug 2016, 01:18 PM

Hi,

Can you please help me on resource grouping, Im unable to bind the appointments based on grouping.

Im able to get the header but unable to bind the appointments.

 <telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1" GroupBy="ServiceType" GroupingDirection="Horizontal" Skin="Web20"
                Height="500px"
                AppointmentStyleMode="Default"  DataKeyField="ID"
                FirstDayOfWeek="Monday" LastDayOfWeek="Friday" DataSubjectField="Subject" DataSourceID="CalendarEntries"
                DataStartField="FromDate" DataEndField="ToDate" 
                SelectedView="DayView"  OnResourceHeaderCreated="RadScheduler1_ResourceHeaderCreated"
                OverflowBehavior="Auto">
                <AdvancedForm Modal="true"></AdvancedForm>
                <MonthView UserSelectable="true"></MonthView>
                <TimelineView />
                <ResourceHeaderTemplate>
                    <asp:Panel ID="ResourceImageWrapper" runat="server" CssClass="ResCustomClass">
                        <asp:Image ID="SpeakerImage" runat="server" AlternateText='<%# Eval("Text") %>'></asp:Image>
                    </asp:Panel>
                </ResourceHeaderTemplate>
                
                <AppointmentTemplate>
                       <%#Eval("ForUser") %> - <%#Eval("Subject") %> - <%#Eval("Reason") %> 
                                 <br />
                                <%#Eval("ServiceStatus") %> 
                                <br />
                                <%#Eval("TeamEventName") %> 
                </AppointmentTemplate>
               <ResourceTypes>
                        <telerik:ResourceType KeyField="ID" Name="Service" TextField="ServiceType" ForeignKeyField="ID"
                            DataSourceID="ServiceDataSource"></telerik:ResourceType>
                        <telerik:ResourceType KeyField="ID" Name="Team" TextField="TeamName" ForeignKeyField="ID"
                            DataSourceID="TeamDataSource"></telerik:ResourceType>
                        <telerik:ResourceType KeyField="ID" Name="ManagerName" TextField="ManagerName" ForeignKeyField="ID"
                            DataSourceID="ManagerDataSource"></telerik:ResourceType>
                        <telerik:ResourceType KeyField="ID" Name="TeamLeadName" TextField="TeamLeadName" ForeignKeyField="ID"
                            DataSourceID="TLDataSource"></telerik:ResourceType>
                    </ResourceTypes>
                <ResourceStyles>
                    <telerik:ResourceStyleMapping Type="ServiceType" Text="PTO" Key="1" BackColor="#eb901b"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="ServiceType" Text="WFH" Key="2" BackColor="#8fd21b"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="ServiceType" Text="OOO" Key="3" BackColor="#278ce9"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="ServiceType" Text="TE" Key="4" BackColor="#f14db2"></telerik:ResourceStyleMapping>
                </ResourceStyles>
                <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
                <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
            </telerik:RadScheduler>

 

 

 

0
Plamen
Telerik team
answered on 22 Aug 2016, 06:59 AM
Hello,

You can refer to this help topic where is described what the DataSource Structure should be and this one how to do a declarative binding.

Regards,
Plamen
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Scheduler
Asked by
Maurizio Piaggio
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Andy
Top achievements
Rank 1
Plamen
Telerik team
Chris Phelps
Top achievements
Rank 1
Kenny
Top achievements
Rank 1
Srivalli
Top achievements
Rank 1
Share this question
or