Toggle resources with webservice enabled scheduler

2 posts, 0 answers
  1. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 11 Jun 2009 Link to this post

    Hi,

    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: http://www.telerik.com/community/forums/aspnet-ajax/scheduler/service-and-grouped-views.aspx 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
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 15 Jun 2009 Link to this post

    Hello,

    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:
    http://www.telerik.com/help/aspnet-ajax/resource_grouping.html

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