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

Handling Resources with a custom Appointment Provider

3 Answers 65 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 26 Mar 2012, 11:11 PM
Implement a custom appointment provider. Is there a mechanism for the provider to get the resources once and then keep them in the scheduler for duration of the page? I would expect the provider to supply the resources and the scheduler to keep them until they are explicitly changed (ie. for another view). But in my case, the provider has to get the resources from the database every time it is accessed (ie. getting appoitments, adding appointment)

I have overridden GetResources(ISchedulerInfo schedulerInfo) to return the resources available to the scheduler; however, it doesn't seem right to me that it queries the backend for the resource definitions on every postback.

If I set the resources programmatically the scheduler seems to maintain the resources on postbacks. For example...

if (!Page.IsPostBack)
{
    ResourceType providers = new ResourceType("Providers");
    providers.DataSource = ScheduleAdapter.GetViewResources(defaultView.ResourceViewID);
    providers.KeyField = "ResourceID";
    providers.TextField = "Resource";
    providers.ForeignKeyField = "ResourceID";
 
    RadScheduler1.ResourceTypes.Add(providers);
}

What am I missing with the implementation of a custom provider? How do you get the provider to supply the scheduler with its Resource collection just once.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 27 Mar 2012, 02:36 PM
Hello Jeff,

This is how the provider model works for RadScheduler. Could you please explain why you need to change the default behavior. Note that there wouldn't be a noticeable performance gain even if it is possible to load the resources just once.

Greetings,
Peter
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
Jeff
Top achievements
Rank 1
answered on 27 Mar 2012, 03:47 PM
No need to change the behavior, I was thinking performance so glad to know there would be no appreciable difference.

If we have an application that allows users to customize their "resource view" with grouping (resourcetypes) of resources, wouldn't we run into trouble using the provider since there is only one per app domain?

I mean could different users view different resource groups and even different group definitions (the resources in a group (resourcetype))?

I hope that is a clear question. 
0
Peter
Telerik team
answered on 28 Mar 2012, 10:17 AM
Hello Jeff,

The way you populate RadScheduler, whether using a provider or a regular data source such as SqlDataSource, does not affect resource grouping or how you display them. Attached is a sample of how to change resources from code behind. Also here is a kb article on resource paging.

Greetings, Peter
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.
Tags
Scheduler
Asked by
Jeff
Top achievements
Rank 1
Answers by
Peter
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or