Multiple Resource Appointment & Group By

17 posts, 0 answers
  1. Maurizio Piaggio
    Maurizio Piaggio avatar
    13 posts
    Member since:
    May 2007

    Posted 08 Oct 2010 Link to this post

    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
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 14 Oct 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy
    Andy avatar
    27 posts
    Member since:
    Nov 2010

    Posted 11 Jun 2012 Link to this post

    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.
  5. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 12 Jun 2012 Link to this post

    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.
  6. Andy
    Andy avatar
    27 posts
    Member since:
    Nov 2010

    Posted 12 Jun 2012 Link to this post

    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

  7. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 14 Jun 2012 Link to this post

    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.
  8. Andy
    Andy avatar
    27 posts
    Member since:
    Nov 2010

    Posted 14 Jun 2012 Link to this post

    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.
  9. Chris Phelps
    Chris Phelps avatar
    10 posts
    Member since:
    Jan 2010

    Posted 21 Jun 2012 Link to this post

    I'm having the same problem, is there a VB version of the sample code?
  10. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 26 Jun 2012 Link to this post

    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.
  11. Chris Phelps
    Chris Phelps avatar
    10 posts
    Member since:
    Jan 2010

    Posted 27 Jun 2012 Link to this post

    Thank you very much!
  12. Kenny
    Kenny avatar
    4 posts
    Member since:
    Oct 2012

    Posted 05 Oct 2012 Link to this post

    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
  13. Kenny
    Kenny avatar
    4 posts
    Member since:
    Oct 2012

    Posted 08 Oct 2012 Link to this post

    hello, any insight about this? I am totally stuck here and need the help urgently.
    Thanks
  14. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 09 Oct 2012 Link to this post

    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.
  15. Kenny
    Kenny avatar
    4 posts
    Member since:
    Oct 2012

    Posted 09 Oct 2012 Link to this post

    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
  16. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 12 Oct 2012 Link to this post

    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.
  17. Srivalli
    Srivalli avatar
    8 posts
    Member since:
    May 2016

    Posted 18 Aug in reply to Veronica Link to this post

    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>

     

     

     

  18. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 22 Aug Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017