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

Looking for RadScheduler sample/examples with EntityDataSource *AND* Multi-value resources

3 Answers 133 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 20 Jun 2011, 06:19 PM
Does anyone have/know of any examples for something similar to this: Telerik Sample For Multiple Resources

Except, with multi-valued resources?  I'm new to entity data sources, and I'm just inheriting a project that has an existing model that works.  But the owner is asking for a new resource type to be added that has a one-to-many relationship for "department(s)".  If this was a standard 3-tier system, I would have no trouble getting this completed.

I've got the database updated to the model I THINK by creating a link table Called "EventDepartments" (Model Layout is attached).  and I have the UI populating with the checkbox list.  But...

  1. There is an Integrity error on insert/update: "The type of the key field 'ID' is expected to be 'System.Int32', but the value provided is actually of type 'System.Object[]'."
  2. I have no idea where to go from here, as I don't know where to look for the issue since the appointment form is auto-generated/handled.



ResourceType:
<telerik:ResourceType KeyField="ID" Name="Departments" AllowMultipleValues="true"
        TextField="Text" ForeignKeyField="DepartmentID"
DataSourceID="EDSDepartments" />

 
Source:
<asp:EntityDataSource runat="server" ID="EDSDepartments" ConnectionString="name=OlympiaEntities"
    DefaultContainerName="OlympiaEntities" EntitySetName="Resources" EnableInsert="True"
    Where="it.ResourceTypeID = 4 && Not it.ParentID Is NULL" EnableUpdate="True">
</asp:EntityDataSource>

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 21 Jun 2011, 03:54 PM
Hi Michael Klink,

Thank you for the detailed information.

Please note that only custom providers can provide the support to allow multi-valued resources (resources that can have multiple values assigned to a single appointment). In your case multi-valued resources will not work with EntityDataSource. The only alternative that I can find is to use CustomAttributes instead of resources and to separate the attribute values by some delimiter (e.g semicolon). Please take a look at this demo for Custom Attributes.

Please let me know if this helps.

Best wishes,
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.

0
Spyder
Top achievements
Rank 1
answered on 15 Aug 2011, 04:33 PM

This is very similar to the question that I have.  I am working on a project where we have built objects that I have bound the RadScheduler but now we would like to be able to include three types of Resources and would like to assignee more than one of each type.  Based on your previous response, I see that this is not possible with Entity, is that true for other object models?  Examples exist that show how to schedule resources with database binding (for instance "The Advanced ASP.NET AJAX Reschedule Customization" video http://tv.telerik.com/watch/aspnet/radscheduler/advanced-radscheduler-customization).  However this video does not show population of an intersection table (that contains the instructorID and WebinarID) that is in your example from the video, would allow the user to schedule many instructors to many scheduled webinars.  Is many to many possible at all?  If so, can you point me in the direction of an video and/or code example that demonstrates the scheduling of many resources of one type. 

See the attached schema design.

 

Thanks for your help.

0
Peter
Telerik team
answered on 18 Aug 2011, 03:22 PM
Hello Spyder,

Yes, this limitation is also true for other data sources. You need to implment a provider. Please, see this help topic - http://www.telerik.com/help/aspnet-ajax/scheduler-provider-with-multi-valued-resources.html

Kind regards,
Peter
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.

Tags
Scheduler
Asked by
Scott
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Spyder
Top achievements
Rank 1
Peter
Telerik team
Share this question
or