This is a migrated thread and some comments may be shown as answers.
Toggle resources with webservice enabled scheduler
1 Answer 35 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Datamex asked on 11 Jun 2009, 11:14 AM

I've placed a scheduler component on my form which uses webservices to populate the scheduler's appointments. Now I want to be able to select the resources I do or don't want to see in the scheduler. The resource population is set to take place serverside, but offcourse it still uses the webservice call to get the actual resources.

I've implemented my own provider to get the resources from my database using Linq. So I now need a way to pass my filter options (which resources should be retrieved) to that function, but I can't find a way to do so.

I've found this post: which is almost what I want. For some reason, I can't cast the SchedulerInfo object to my own custom SchedulerInfo object and thus not read the extra properties I fitted in there. And the only thing the webservice does is transfer the call to the GetResources function of my controller, which ultimately leads to a call of the GetResourcesByType function on my provider. That last one only has the grid and a resourceType string as parameters, where did the SchedulerInfo object go?

So I have two problems:
1) Why can't I cast the SchedulerInfo object to my own SchedulerInfo object
2) How should I pass the filter options to the actual GetResourcesByType method? I thought about temporarily storing them in a static class, but I wonder whether there isn't a better option.

Kind regards

1 Answer, 1 is accepted

Sort by
T. Tsonev
Telerik team
answered on 15 Jun 2009, 04:12 PM

Your GetResources web service method should directly accept your custom ISchedulerInfo object, no casting necessary. The framework will construct it from the JSON that's coming down the wire.

More info on resource grouping when using Web Service data binding:

We don't directly support passing additional arguments to the provider methods. The provider base class wasn't designed with that in mind, but we're planning to update it, so this will become possible. For the moment you can use the Session to transfer information to the provider. Just make sure to enable it for the GetResources method:

[WebMethod(EnableSession = true)]
public IEnumerable<ResourceData> GetResources(MySchedulerInfo schedulerInfo)

I hope this helps.

All the best,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Asked by
Top achievements
Rank 2
Answers by
T. Tsonev
Telerik team
Share this question