I have been playing around with the Scheduler and have created a data provider that inherits from SchedulerProviderBase. However, instead of instantiating the provider via web.config etc, I have instead created a new provider object each time the page is loaded (ie in Page_Load). So, like this:
RadScheduler1.Provider = new SchedulerDataProvider( venueId, groupId );
This is so I can pass in some arguments to the provider so it returns different data based on the parameters sent in by the user.
This was all working fine until doing a postback from a dropdownlist in the page. A that point, the standard " DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding" exception was being thrown even before Page_Load is fired, as those fields are not set.
I got around this by just setting those fields to anything - that seemed to work and the scheduler managed to ignore the fact that it did not yet have any data (which is fine by me, as I need to reload the data each time).
However, when searching the Knowledge Base for help on the above, I came across the following:
||The provider is instantiated once per application domain and is shared across threads. RadScheduler ensures basic thread safety by encapsulating each provider in a wrapper that provides locks around each of its public methods. However, you should take care of synchronizing access to instance field members where appropriate.
My question is this: I take it by doing what I am doing, the provider is NOT only instantiated the once, and a new one is created each time the page loads. Is that the case? Can I not worry about threading issues by doing it the way I am? If not, any suggestions on how I should actually implement?
Thanks for your help.